Home  >  Article  >  Operation and Maintenance  >  Root user cannot log in via telnet in Linux system

Root user cannot log in via telnet in Linux system

王林
王林Original
2019-12-17 11:06:463381browse

Root user cannot log in via telnet in Linux system

Linux root user cannot log in with telnet

Found the problem:

#1==》 Before using telnet to log in To install the telent service and start the service.

This step is carried out normally, there is no surprise. You can go to Baidu to install the telnet service by yourself. I installed it using yum.

2==》Telnet remote login

Recommended online learning video tutorial:linux video tutorial

There is a problem with this step, after telnet device ip (Default port 23) When entering the username and password input interface, it keeps prompting Login incorrect when logging in using root. Then I checked the login log. Type the command tail /var/log/secure to view the log as follows:

Root user cannot log in via telnet in Linux system

The last three lines in the log are the information about my last login failure. Look at the third to last line pam_securetty prompt access denied (access denied): tty pts/3 is not secure (terminal pts/3 is not secure).

Logging in to the system also requires calling the pam module, and login verification is configured in the /etc/pam.d/login file. When you open this file, you will see that there is a line containing the pam_securetty.so tag. Then use the man tool to view the man pam_securetty result as follows:

The function is to restrict the login of the root user.

The first line of description explains: pam_securetty is a pam module, which verifies the login of the root user to ensure that the tty (terminal) logged in by the root is safe. So what kind of terminal is safe – – as defined by the listing in /etc/securetty (those listed in this file are safe).

So based on the above error log and this explanation, you should roughly understand that the reason for the root login failure is that the terminal "pts/3" is not listed in the /etc/securetty file.

Solution:

So you need to open /etc/securetty and create a new line to add "pts/3" in the original format.

Root user cannot log in via telnet in Linux system

Then restart the telnet service. At this point, the root user can log in remotely using telnet.

Recommended related articles and tutorials: linux tutorial

The above is the detailed content of Root user cannot log in via telnet in Linux system. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn