Last active
April 9, 2018 05:19
-
-
Save boywijnmaalen/49e271ac7bb11effabc9 to your computer and use it in GitHub Desktop.
How to execute a command as a different user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# execute command on behave of another user | |
$ su -s /bin/sh <username> -c "whoami" | |
# become another user: | |
$ sudo su - <username> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment