Home » Linux Host, Ubuntu, SysAdmin » Linux Commands » “su” – Switch User Linux Command

“su” – Switch User Linux Command

“su” stands for “switch user” is a Linux command used to switch the current user to another user.

This allows you to run commands or access resources as a different user.

For example: “su [username]” will switch to the specified user account, and “su -” will switch to the root user.

If you tries to use “su” command with the username which is not existed on your machine, you will get an error as,

$ su devlab
su: user devlab does not exist or the user entry does not contain all the required fields

where, we tried to switch to new user “devlab” which was not existed on my machine so it showed the error.

Leave a Comment