CentOS 7安装Telnet服务进行远程管理

1. 查看是否安装Telnet服务

  [root@localhost ~]# rpm -qa|grep telnet-server

 

2. 安装 telnet-server

  [root@localhost ~]# yum install telnet-server

 

3. 再次查看是否安装Telnet服务

  [root@localhost ~]# rpm -qa |grep telnet-server

    telnet-server-0.17-64.el7.x86_64  //出现这个说明已经安装了

 

4. 查看是否安装 xinetd 服务

  //原因:telnet服务不是独立的服务,在xinetd服务下,由xinetd服务管理

  [root@localhost xinetd.d]# rpm -qa xinetd  //没反应就是没有安装

 

5. 安装 xinetd 服务

  [root@localhost xinetd.d]# yum install xinetd

 

6. 将xinetd服务和telnet服务设置为开机自启动

  [root@localhost xinetd.d]# systemctl enable xinetd.service

  [root@localhost xinetd.d]# systemctl enable telnet.socket

    Created symlink from /etc/systemd/system/sockets.target.wants/telnet.socket to /usr/lib/systemd/system/telnet.socket.  //说明开机自启添加 成功

 

7. 启动 xinetd 和 telnet 服务

  [root@localhost xinetd.d]# systemctl start xinetd.service

  [root@localhost xinetd.d]# systemctl start telnet.socket

 

8. 查看xinetd服务和telnet服务的状态(非必须步骤)

  [root@localhost xinetd.d]# systemctl status xinetd.service

  

 

   [root@localhost xinetd.d]# systemctl status telnet.socket

  

 

9. 开启root登入,通过关闭安全的方法实现

  [root@localhost xinetd.d]# cd /etc/

  [root@localhost etc]# ls secure*

    securetty

  [root@localhost etc]# mv securetty securetty.bak

  注:也可以在securetty文件的末尾加上pts/0  pts/1的方法开启root登录,这样就不用关闭安全了

 

10. 配置防火墙规则

  [root@localhost etc]# firewall-cmd --permanent --add-port=23/tcp      //开放23端口

  [root@localhost etc]# firewall-cmd --reload    //重新加载防火墙,使改动生效

 

11. 现在可以通过Telnet工具进行远程登录管理了

posted @ 2021-06-25 10:35  凡是過往;皆為序章  阅读(485)  评论(0编辑  收藏  举报