大佬教程收集整理的这篇文章主要介绍了centos解决bash: telnet: command not found...&& telnet: connect to address 127.0.0.1: Connection refused拒绝连接,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
[[email protected] src]# rpm -q telnet-server
package telnet-server is not installed
[[email protected] src]# telnet 192.168.81.129
bash: telnet: command not found...
rpm -qa |grep telnet
没有则安装,有跳过
yum install telnet-server -y && yum install telnet.* -y
启动telnet 服务
[[email protected] src]# sudo service xinetd restart
RedirecTing to /bin/systemctl restart xinetd.service
确认启动telnet服务
[[email protected] xinetd.d]# ps -ef | grep xinetd
root 33139 1 0 12:11 ? 00:00:00 /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid
root 35218 30125 0 12:27 pts/0 00:00:00 grep --color=auto xinetd
尝试一下
[[email protected] src]# telnet localhost
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
[[email protected] src]# netstat -tnl |grep 23
没反应检查telnet默认端口23不在开通防火墙23端口
开放23端口
firewall-cmd --zone=public --add-port=23/tcp --peRMANent
重启防火墙
firewall-cmd --reload
检查端口开启23情况
[[email protected] xinetd.d]# firewall-cmd --zone=public --list-ports
8989/tcp 8686/tcp 40127/tcp 23/tcp
再尝试一下
[[email protected] src]# telnet localhost
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
检查 cd /etc/xinetd.d
检查telnet@L_675_11@存不存在,不存在touch telnet
vi /etc/xinetd.d/telnet
#default:yes # description: The telnet server servestelnet sessions; it uses # unencrypted username/password pairs for authentication. service telnet { flags = REUSE socket_type = stream wait = no user = root server =/usr/sbin/in.telnetd log_on_failure += USERID disable = no }
disable = no
然后重启 xinetd
[[email protected] src]# sudo service xinetd restart
RedirecTing to /bin/systemctl restart xinetd.service
设置xinetd开机自启动:
systemctl enable xinetd.service
检查telnet效果
[[email protected] xinetd.d]# telnet localhost
Trying ::1...
Connected to localhost.
Escape character is ‘^]‘.
Kernel 3.10.0-957.10.1.el7.x86_64 on an x86_64
hostuser login:
以上是大佬教程为你收集整理的centos解决bash: telnet: command not found...&& telnet: connect to address 127.0.0.1: Connection refused拒绝连接全部内容,希望文章能够帮你解决centos解决bash: telnet: command not found...&& telnet: connect to address 127.0.0.1: Connection refused拒绝连接所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。