login Command Cheat Sheet
The login command is used to begin a new session on a terminal. It is typically invoked automatically during system boot.
Manually Invoke Login
login
Login as Another User
login username
Then enter the password when prompted.
Switch to Another User (Preferred)
su - username
Or:
sudo -i -u username
Related Files
/etc/passwd: user account definitions/etc/shadow: encrypted passwords/var/log/auth.log: authentication logs
Notes
- Normally invoked by getty.
- Avoid manual use unless in a TTY or recovery shell.