Changing users in the Linux shell

Last Updated : Aug 27, 2023 |

Once logged in to the command-line, it is sometimes required to change to a different account. The standard Linux utility ‘su’ is used to transition from one account to another. For example, to change to the root account:

su - root

When SELinux is disabled, you will be prompted for the target account’s credentials.

When SELinux is enabled, you will first be prompted for the current account’s credentials, followed by the target account credentials. The credentials prompted for could be either the account’s password, or the EASG credentials for EASG-enabled accounts.