Linux su command

The su command is most commonly used to switch to another user. You will then be able to run commands as if you were that user and in their environment. In this article, we will show you the basic usage of the Linux su command.

Switch to another user

su anotherUser

Preserve variables

This will allow you to keep your own defined environment variables

su -m anotherUser

Switch to another user even if he doesn’t have shell access enabled (SSH)

su -s /bin/bash anotherUser
  • 0 användare blev hjälpta av detta svar
Hjälpte svaret dig?

Relaterade artiklar

Linux tar Command

The Linux tar command is used to compress and extract files to and from an archive. In this...

Linux top command

If you wish to monitor the performance of your VPS or Dedicated server and track processes, RAM...

Linux ping command

If you wish to test your connection to a server from your Linux system you can use the Linux ping...

Linux file command

The file command is used to check a file’s type and contents in Linux environment. It is most...

Linux export command

When you’re managing your shell’s variables and you wish to save them to your environment you can...