The login command can be used to log out the current Logon account and log in with another user name. Of course, you can also specify the corresponding account to log on.
Login
[Syntax] login [Options] [parameters]
[Details] directly enter login as the login account name, and press Enter. The system will prompt you to enter the password.
[Option]
Option corresponding function-p maintains the current environment during login. -H: Specify the remote computer name-f: Specify the user name
Example:
1. log on to the kwxgd account using login
Enter login in the current account (root). The system will automatically log off the root account and give a new Logon account string.
Login
Enter your other user name and password as prompted.
If the account password is correctly verified, you can log on to the kwxgd account.
2. Log On directly using login kwxgd
Login kwxgd
If you execute login kwxgd in the current account, the password input box is displayed. You do not need to enter the account again.
Note:
If the "/etc" directory contains the "nologin" file, only root login is allowed, and other users cannot log on.