46 lines
813 B
Plaintext
46 lines
813 B
Plaintext
quick command list:
|
|
|
|
find file:
|
|
sudo find -name "example"
|
|
|
|
lists all users:
|
|
awk -F':' '{ print $1}' /etc/passwd
|
|
|
|
prints all administrator users:
|
|
grep '^sudo:.*$' /etc/group | cut -d: -f4
|
|
|
|
add user to group:
|
|
sudo usermod -a -G GROUP USERNAME
|
|
|
|
remove user from group:
|
|
sudo deluser USERNAME GROUP
|
|
|
|
sign into account of user:
|
|
sudo su - USERNAME
|
|
|
|
change password:
|
|
passwd
|
|
|
|
check if UFW is enabled:
|
|
sudo ufw status
|
|
|
|
enable ufw:
|
|
sudo ufw enable
|
|
|
|
find active services:
|
|
systemctl list-units --type=service --state=active
|
|
|
|
temporarily stop service:
|
|
sudo service SERVICE stop
|
|
sudo systemctl stop SERVICE
|
|
|
|
remove service:
|
|
update-rc.d -f SERVICE remove
|
|
sudo systemctl disable SERVICE
|
|
|
|
config ssh:
|
|
sudo gedit /etc/ssh/sshd_config
|
|
|
|
print out whole directory tree with perms, ignoring a few directories:
|
|
ls -Rl / -I{home,var,tmp}
|