Skip to content

Instantly share code, notes, and snippets.

@henri
Last active February 6, 2024 23:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henri/3b9b8ca40df65991e876cb32650d3b9c to your computer and use it in GitHub Desktop.
Save henri/3b9b8ca40df65991e876cb32650d3b9c to your computer and use it in GitHub Desktop.
sudo / su cheat sheet
# login as a user if they do not have a shell :
su - <user> -s /bin/bash
# example logging in as www-data :
su - www-data -s /bin/bash
# add user to sudo group
usermod -aG sudo <user-to-grant-sudo-access>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment