Linux command: su

Quick startsuCommand to switch the shell to another user

When you log in to the terminal shell as a user, you may need to switch to another user.

For example, you log in as the root user to perform some maintenance, but then you want to switch to a user account.

you can use itsucommand:

su <username>

E.g:su flavio.

If you are logged in as a user, runsuNo other prompts will prompt you to enterrootUser password, because this is the default behavior.

suA new shell will be launched as another user.

When finished, enterexitIn the shell, the shell will be closed and returned to the shell of the current user.

ThissuThis command is valid on Linux. On macOS, unless you enable the root user (hint: you can usesudoinstead)

Download mine for freeLinux Command Manual

More cli tutorials: