Skip to main content

The su utility requests appropriate user credentials via PAM and switches to that user ID (the default user is the superuser). A shell is then executed.

# To switch to user "jon" (password required):
su jon

# To switch to superuser (admin password required):

# To run the command "pwd" as user "jon":
su jon -c pwd

# To switch to user jon and simulate a full login shell:
su - jon

# To simulate a login for "root":
su -