For security reasons, Linux does not allow root users to use Telnet. generally, we use a normal account to log on, and use su-to switch to the root account when the permission is required. below, we usually modify/etc/securetty to achieve the effect. The following is for testing only. Try using rootte...
For the sake of security, in Linux, it is not allowed to use the root user for Telnet. generally, we use a common account for login.
You can use su-to switch to root. The/etc/securetty is usually modified below to achieve the effect. The following is for testing only.
Try using root telnet to log on
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
Kernel 2.6.18-164. el5 on an i686
Login: root
Password:
Login incorrect
Logon not allowed
Modify/etc/securetty and add pts/0 to it.
Pts/0 # added before the file
Console
Vc/1
Vc/2
Try again
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
Kernel 2.6.18-164. el5 on an i686
Login: root
Password:
Last login: Wed Dec 8 21:23:35 on tty1
Our server will be maintained at today
[Root @ lyy ~] #
Root login successful!
About/etc/securetty
This file controls the device that the root user logs on to. it records the device names that can be logged on as the root user, such as tty1 and tty2. A user cannot be a device that never exists in this file.
Log on as the root user. In this case, the user can only log in as a common user, and then use the su command to convert it to the root user. The format of the/etc/securetty file is as follows:
#/Etc/securetty: list of terminals on which root is allowed to login.
# See securetty (5) and login (1 ).
Console
# For people with serial port les
TtyS0
# For devfs
Tts/0
# Standard les
Tty1
Tty2
Tty3
...
If/etc/securetty is an empty file, the root user cannot log on to the system from the device of the task. You can only log on as a common user, and then use the su command to convert it to the root user. If the/etc/securetty file does not exist, the root user can log on from anywhere. This will cause security issues, so the/etc/securetty file must exist in the system.
Author "Liyy study notes"