41 lines
667 B
Plaintext
41 lines
667 B
Plaintext
% misc
|
|
|
|
# Update system
|
|
sudo apt update && sudo apt upgrade
|
|
|
|
# Clean APT
|
|
sudo apt autoclean && sudo apt autoremove
|
|
|
|
# List users
|
|
cat /etc/passwd | awk -F: '{ print $1}'
|
|
|
|
# User information
|
|
sudo id <user>
|
|
|
|
# Change user password
|
|
sudo passwd <user>
|
|
|
|
# Create user with home
|
|
sudo useradd -m <username>
|
|
|
|
# Create user without home
|
|
sudo useradd <username>
|
|
|
|
# Delete an user
|
|
sudo deluser <user>
|
|
|
|
# List all groups
|
|
cat /etc/group
|
|
|
|
# Add user to group
|
|
sudo usermod -a -G <group> <user>
|
|
|
|
# Remove user from a group
|
|
sudo deluser <user> <group>
|
|
|
|
# Port binding
|
|
sudo lsof -i:<port>
|
|
|
|
$ user: cat /etc/passwd | awk -F: '{ print $1}'
|
|
$ group: cat /etc/group | awk -F: '{ print $1}'
|