login command User login to the system.
The login command is used to give the login screen, which can be used to re-login or switch the user identity, or change the login identity at any time by its function.
login command Function Description
Use the login command to allow users to log in to the system. If no parameters are specified, the login prompts for the user name. If the user is not root, and if the /etc/nologin file exists, the contents of this file are displayed on the screen and the login is terminated.
login command Syntax
login [Option] [Username]
Option Meaning:
The meanings of the options in the command are shown below.
Option | Description |
---|---|
-h | Use another server to pass the name of the remote host to log in so it can be placed in utmp and wtmp |
-p | Log in without damaging the environment |
-f | Used to skip the second login authentication |
login command Example
User Login System
[root@rhel ~]# login