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:
-
Open your terminal.
-
Type the following command and press Enter:
su - usernameReplace
usernamewith 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.
