Telnet in CentOS allows root users to log on

Source: Internet
Author: User
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.