Linux离线安装Telnet

前言:由于服务器部署在内网环境,不能yum安装
1.先从网站下载好我们所需要到的三个rpm包
http://www.rpmfind.net/linux/rpm2html/search.php?query=xinetd&submit=Search+...&system=&arch=

image.png

三个依赖包分别是:

-rw-r--r-- 1 root root  65816 Apr  1 10:01 telnet-0.17-65.el7_8.x86_64.rpm
-rw-r--r-- 1 root root  41996 Apr  1 10:01 telnet-server-0.17-65.el7_8.x86_64.rpm
-rw-r--r-- 1 root root 131484 Apr  1 10:01 xinetd-2.3.15-14.el7.x86_64.rpm

2.检查是否之前安装过这些依赖包

[root@iz2zegxc1wmp4xnnyxgzuvz Telnet安装rpm]# rpm -qa | grep telnet
[root@iz2zegxc1wmp4xnnyxgzuvz Telnet安装rpm]# rpm -qa | grep telnet-server
[root@iz2zegxc1wmp4xnnyxgzuvz Telnet安装rpm]# rpm -qa | grep xinetd

3.依次安装依赖包
顺序是xinetd>telnet>telnet-server

[root@iz2zegxc1wmp4xnnyxgzuvz Telnet安装rpm]# rpm -ivh xinetd-2.3.15-14.el7.x86_64.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:xinetd-2:2.3.15-14.el7           ################################# [100%]
[root@iz2zegxc1wmp4xnnyxgzuvz Telnet安装rpm]# rpm -ivh telnet-0.17-65.el7_8.x86_64.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:telnet-1:0.17-65.el7_8           ################################# [100%]
[root@iz2zegxc1wmp4xnnyxgzuvz Telnet安装rpm]# rpm -ivh telnet-server-0.17-65.el7_8.x86_64.rpm 
Preparing...                          ################################# [100%]
Updating / installing...
   1:telnet-server-1:0.17-65.el7_8    ################################# [100%]

4.检查是否安装成功

[root@iz2zegxc1wmp4xnnyxgzuvz Telnet安装rpm]# rpm -qa | grep telnet
telnet-server-0.17-65.el7_8.x86_64
telnet-0.17-65.el7_8.x86_64
[root@iz2zegxc1wmp4xnnyxgzuvz Telnet安装rpm]# rpm -qa | grep xinetd
xinetd-2.3.15-14.el7.x86_64

5.修改telnet配置文件,如果没有则自己创建

vim /etc/xinetd.d/telnet
# default: on
# description: The telnet server serves telnet sessions; it uses 
# unencrypted username/password pairs for authentication.

#disable这个默认是yes,只有改成no才可以启动telnet
service telnet
{undefined
    flags=REUSE
    socket_type=stream
    wait=no
    user=root
    server=/usr/sbin/in.telnetd
    log_on_failure += USERID
    disable= no
}

6.修改完成后需要xinetd

[root@iz2zegxc1wmp4xnnyxgzuvz Telnet安装rpm]# service xinetd restart
Redirecting to /bin/systemctl restart  xinetd.service
[root@iz2zegxc1wmp4xnnyxgzuvz Telnet安装rpm]# systemctl restart xinetd.service

7.检查xinetd是否重启成功

[root@iz2zegxc1wmp4xnnyxgzuvz Telnet安装rpm]# ps -ef| grep xinetd
root     13286     1  0 10:13 ?        00:00:00 /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid
root     13352 12394  0 10:15 pts/1    00:00:00 grep --color=auto xinetd
[root@iz2zegxc1wmp4xnnyxgzuvz Telnet安装rpm]# telnet 127.0.0.1
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused

有输出则说明telnet安装成功

你可能感兴趣的:(Linux离线安装Telnet)