How Do I Login as Another User in Linux?
Contents to Change to a Different User and Create a Session as If the Other User Had Logged in from a Command Prompt, Type “Su -” Followed by a Space and the...
To change to a different user and create a session as if the other user had logged in from a command prompt, type “su -” followed by a space and the target user’s username. Type the target user’s password when prompted.
How do I switch users in Linux terminal?
To switch to the root user on Ubuntu-based distributions, enter sudo su in the command terminal. If you set a root password when you installed the distribution, enter su. To switch to another user and adopt their environment, enter su – followed by the name of the user (for example, su – ted).
What is the command to log a user in Linux?
Here’s how to use it in a few easy steps:
- Install sudosh on your system; this is a shell wrapper around the sudo command that makes a user sudo themselves (not root ) and can be used as a system login shell.
- Enable sudo logging. …
- Add this command to /etc/shells to permit logins using it: /usr/bin/sudosh.