su command
Last updated
Was this helpful?
Last updated
Was this helpful?
While you're logged in to the terminal shell with one user, you might need to switch to another user.
For example you're logged in as root to perform some maintenance, but then you want to switch to a user account.
You can do so with the su
command:
For example: su flavio
.
If you're logged in as a user, running su
without anything else will prompt you to enter the root
user password, as that's the default behavior.
su
will start a new shell as another user.
When you're done, typing exit
in the shell will close that shell, and will return you back to the current user's shell.