By default, linux does not allow the root user to log on to the linux host through telnet. to allow the root user to log on, you can use one of the following three methods: 1. modify the remote logon restriction in the login file RedHat, as shown in/etc/pam. in the d/login file, if you cancel the restricted content, the restriction does not work. # % PAM-1.0auth [user_unknown = ignore
By default, linux does not allow the root user to log on to the linux host through telnet. to allow the root user to log on, you can use one of the following three methods:
1. modify the login file
Remote logon restrictions in RedHat are reflected in/Etc/pam. d/loginFile, if you cancel the restricted content,The restriction does not work..
# % PAM-1.0
Auth [user_unknown = ignore success = OK ignore = ignore default = bad] pam_securetty.so
Auth include system-auth
# Account required pam_nologin.so
Account include system-auth
Password include system-auth
# Pam_selinux.so close shocould be the first session rule
Session required pam_selinux.so close
Session include system-auth
Session required pam_loginuid.so
Session optional pam_lele.so
# Pam_selinux.so open shoshould only be followed by sessions to be executed in the user context
Session required pam_selinux.so open
Session optional pam_keyinit.so force revoke
~
2. remove the securetty file
Validation rule settings are set in the/etc/security file, which defines that root users can only record on the terminal of the tty1-tty6, you can delete the file or change the name of the file to avoid authentication rules and achieve remote logon by the root user.
[Root @ nodel ~] # Mv/etc/securetty. bak
3. modify the securetty file
[Root @ nodel ~] # Vim/etc/securetty
Console
Vc/1
....
....
Vc/10
Tty1
....
Tty11
Pts/1
Pts/2
....
....
....
Pts/11
Generally, it is not recommended that you directly use the root user to remotely log on to the system through telnet, because telnet adopts the plaintext mode during data transmission. if the packets are intercepted, it is easy to obtain the login password of the root user. it is recommended that you remotely log on to the root user through telnet and then su to the root user, which is relatively safe. If you have to use the root user for remote connection, we recommend that you use SSH.