Skip to content

Instantly share code, notes, and snippets.

@Alex-Just
Last active January 16, 2017 12:41
Show Gist options
  • Save Alex-Just/bac37567bb79b41d1fde89e4333a22fe to your computer and use it in GitHub Desktop.
Save Alex-Just/bac37567bb79b41d1fde89e4333a22fe to your computer and use it in GitHub Desktop.
whoami
# Add user to sudoers
sudo adduser <username> sudo
# Switch user
su - user2
# List all local users
cut -d: -f1 /etc/passwd
# Add a new user
sudo adduser new_username
# Remove/delete a user, first you can use:
sudo userdel username
# Then you may want to delete the home directory for the deleted user account :
sudo rm -r /home/username
# Check which users are logged in:
who
# Log-out the user by sending the KILL signal to the user-process with:
sudo pkill -KILL -u <username>
# Get the current group I'm logged in as
id -gn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment