Copied to clipboard

su

The `su` command is a command-line tool in Linux systems used to switch user identities. It allows you to switch from one user account to another, including root user identity, without logging out. This allows you to execute commands that require specific permissions without exiting the current session.
- represents root user

Example

  • Switch to root user: su -
  • Switch to other user: su username
  • Switch to other user and use a different shell: su -s /bin/sh username
  • Switch to other user and execute specific command: su -c "command" username