Home > OS >  Have a question, about the login command
Have a question, about the login command

Time:10-12

Just started to learn Linux didn't take long, today found that there are some problems with the login command
In centos6.5 system inside the virtual machine, and then after tty terminal login successful
If the login is the root user, this time with the login command will directly logged on,
If the login is ordinary users, use the login command trying to log in again at this time other users will be an error: the login incorrect
But if after log out, by which user can log in...

I just can't understand, why only in the case of not login can normal login, the login command switch can't realize the role of the user? Must have to quit?
In addition, the root user with the login command is what will logout directly???????


This is a log
 Mar 28 19:59:31 centos01 unix_chkpwd [3643] : check pass; The user unknow 
Mar 28 19:59:33 centos01 unix_chkpwd [3644] : check pass; User unknown
Mar 28 19:59:33 centos01 unix_chkpwd [3644] : password check failed for user (CV)
Mar 28 19:59:33 centos01 login: pam_unix (login: auth) : the authentication failure. Logname cx 500 euid uid===500=tty tty3 ruser=rhost=user=CV
1 the FROM Mar 28 19:59:35 centos01 login: FAILED login (null) FOR CV, Authentication failure


This is PAM. D. in the login file
 # % PAM - 1.0 
Auth [user_unknown=ignore success==ok to ignore ignore default=bad] pam_securetty. So
Auth include system - auth
The account of required pam_nologin. So
The account include system - auth
Password include system - auth
# pam_selinux. So the close should be the first session rule
# session required pam_selinux. So close
The session required pam_loginuid. So
The session optional pam_console. So
# pam_selinux. So the open should only be followed by sessions to be executed in the user context
The session required pam_selinux. So the open
The session required pam_namespace. So
The session optional pam_keyinit. So the force revoke
The session include system - auth
- the session optional pam_ck_connector. Sozz


This is PAM. D. in the system - auth file
 # % PAM - 1.0 
# This file is auto - generated.
# the User changes will be destroyed the next time authconfig is run.
Auth required pam_env. So
Auth sufficient pam_fprintd. So
Auth sufficient pam_unix. So nullok try_first_pass
Auth requisite pam_succeed_if. So the uid & gt;=500 the -quiet
Auth required pam_deny. So

The account of required pam_unix. So
The account sufficient pam_localuser. So
The account sufficient pam_succeed_if. So the uid & lt; 500 the -quiet
The account of required pam_permit. So

Password requisite pam_cracklib. So try_first_pass retry=3 type=
Password sufficient pam_unix. So sha512 shadow nullok try_first_pass use_authtok
Password required pam_deny. So

The session optional pam_keyinit. So revoke
The session required pam_limits. So
The session/success=1 default=ignore pam_succeed_if. So the service in the crond quiet use_uid
Session required pam_unix. So

CodePudding user response:

Hadn't used the login, the user switch, usually use the su

CodePudding user response:

reference 1st floor aabbabababaa response:
hadn't used the login, user switching, generally with the su


I already know the answer, this is the setting of the command itself,
  • Related