問題描述:
centos 系統沒有 telnet 命令
bash: telnet: command not found
1.安裝telnet服務 (3個)
yum install xinetd telnet telnet-server -y
修改配置文件():
# 修改/etc/xinetd.d/telnet # 將disable = yes 值改為no disable = no
2.配置開機啟動
chkconfig telnet on
3.需要激活xinetd服務
# service xinetd restart 或者 #/etc/rc.d/init.d/xinetd restart
4.測試是否ok
這是ok的情況。不ok的時候,會提示連接被拒絕。
[heliang@localhost ~]$ telnet 127.0.0.1 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. CentOS release 6.9 (Final) Kernel 2.6.32-696.el6.x86_64 on an x86_64
另外一個安裝版本,是在 騰訊的虛擬雲主機下面的 centos系統(命令略有不同)
1.安裝telnet服務
yum install xinetd telnet telnet-server -y
修改配置文件():
# 修改/etc/xinetd.d/telnet # 將disable = yes 值改為no disable = no
2.安裝完成后,將xinetd服務加入開機自啟動:
systemctl enable xinetd.service
3.將telnet服務加入開機自啟動:
systemctl enable telnet.socket
4.最后,啟動以上兩個服務即可:
由於telnet服務也是由xinetd守護的,所以安裝完telnet-server,要啟動telnet服務就必須重新啟動xinetd 。
systemctl start telnet.socket
systemctl start xinetd(或service xinetd start)