How to switch user without password?

QuestionsQuestions8 SkillsProYour First Linux LabNov, 07 2025
0100

To switch to another user without needing a password, you can use the su command with the - option, but this typically requires that the user you are switching to does not have a password set. Here’s how to do it:

  1. Open your terminal.

  2. Type the following command and press Enter:

    su - username

    Replace username with the actual username you want to switch to.

If the user has no password set, you should be able to switch without being prompted for a password.

Alternatively, if you have sudo privileges, you can use:

sudo -u username -i

This will switch you to the specified user without requiring a password, provided that your user has the necessary permissions in the sudoers file.

0 Comments

no data
Be the first to share your comment!