Switching to the Sudo User
To switch to the new (or newly-elevated) user account with the su (substitute user):
-
Execute the following command:
su - UserName - Enter the password if prompted.
-
To list the contents of the /root directory, execute the following
command:
sudo ls -la /root -
Enter the password if prompted.
The terminal displays the list of directories. Since listing the contents of the /root directory requires Sudo privileges, this is an easy way to prove that the new user can use the Sudo command.
