1. Install the Telnet software package
After installing the telnet service 我们需要在/etc/xinetd.d目录下修改telnet文件
, start the telnet service
But after downloading tenet, I found that there are no files in the /etc/xinetd.d directory.
The reason is that we have not installed 没有安装xinetd
the software package . After using yum search to find the software package, we will install it.
Second, install the xinetd package
yum search xinetd
yum install -y xinetd
After the installation is complete, check the /etc/xinetd.d directory again.
You can see that although we have files now, we 并没有发现 telnet文件
can’t find a way at this time, so I choose myself创建一个telnet文件
3. Create and modify telnet files
vim /etc/xinetd.d/telnet
service telnet
{
disable = no
flags = REUSE
socket_type = stream
wait = no
user = root
server =/usr/sbin/in.telnetd
log_on_failure += USERID
disable = no
}
Save and exit after creation.
Let's restart the telnet process
4. Restart the telnet service
[root@web ~]# systemctl restart telnet.socket
5. Test whether telnet is enabled
Now try again to log in to the local server using telnet
(1) Local login
[root@web ~]# telnet localhost //登录本地
Trying ::1...
Connected to localhost.
Escape character is '^]'.
Kernel 3.10.0-1160.el7.x86_64 on an x86_64
web login: toto //登录的用户要用普通用户 因为特权用户登录telnet极其不安全
Password: //输入密码
Last login: Sat Jun 17 14:08:12 from www.lin.2020skills.com
[toto@web ~]$ //登录成功
Use the ip address and domain name below登录其他linux服务器的测试
(2) ip login:
[root@web ~]# telnet 10.10.20.101
Trying 10.10.20.101...
Connected to 10.10.20.101.
Escape character is '^]'.
Kernel 3.10.0-1160.el7.x86_64 on an x86_64
dns login: toto
Password:
Last login: Sat Jun 17 14:08:27 from www
[toto@dns ~]
login successful
(3) Domain name login
[root@web ~]# telnet dns.lin.2020skills.com
Trying 10.10.20.101...
Connected to dns.lin.2020skills.com.
Escape character is '^]'.
Kernel 3.10.0-1160.el7.x86_64 on an x86_64
dns login: toto
Password:
Last login: Sat Jun 17 14:16:39 from www
[toto@dns ~]$
login successful!
Now we have successfully modified and enabled the telnet service.
If you have any questions in the future, you can discuss and communicate in the comment area.