Skip to main content

Switch shell to another user.

# To switch to superuser (requires the root password):
su

# To switch to a given user (requires the user's password):
su <username>

# To switch to a given user and simulate a full login shell:
su - <username>

# To execute a command as another user:
su - <username> -c "<command>"