login Command Examples in Linux

The login utility logs users (and pseudo-users) into the computer system. If no user is specified, or if a user is specified and authentication of the user fails, login prompts for a user name. Authentication of users is configurable via pam. Password authentication is the default.

If the file /etc/nologin exists, login displays its contents to the user and exits. This is used by shutdown(8) to prevent users from logging in when the system is about to go down.

login Command Examples

1. To login to the system:

# login 

2. To tell login not to destroy the environment:

# login -p 

3. To skip the second login authentication:

# login -f 

4. To display version information:

# login -V

5. To display help text:

# login --help

login command reads the /etc/login.defs configuration file.

Related Post