At various times, we may find it necessary to take on the identity of another user. Often we want to gain superuser privileges to carry out some administrative task, but it is also possible to “become” another regular user to perform such tasks as testing an account. There are three ways to take on an alternate identity:
Log out and log back in as the alternate user.
We will skip the first technique because we know how to do it and it lacks the convenience of the other two. From within your own shell session, the
su command allows you to assume the identity of another user and either start a new shell session with that user’s ID or issue a single command as that user. The
sudo command allows ...