Switching to the Sudo User

To switch to the new (or newly-elevated) user account with the su (substitute user):

  1. Execute the following command:
    su - UserName
  2. Enter the password if prompted.
  3. To list the contents of the /root directory, execute the following command:
    sudo ls -la /root
  4. 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.