telnet:リモートホストに接続できません:接続が拒否されました
Telnet Unable Connect Remote Host
周囲:
CentOSリリース6.10(最終版)
$ telnet 127.0.0.1 Trying 127.0.0.1... telnet: Unable to connect to remote host: Connection refused
その理由は、telnetサービスがシステムで利用できないためであり、解決策は次のとおりです。
yum -y install telnet-server service xinetd start netstat -tlunp | grep 23 # Discover 23 port has not been monitored, indicating that the telnet service is not open
構成ファイルを変更します():
# Modify /etc/xinetd.d/telnet # Change the disable = yes value to no disable = no
telnetサービスを再起動します
service xinetd restart # In this machine test, the discovery can be successful telnet 127.0.0.1 Trying 127.0.0.1... Connected to 127.0.0.1. ..Omit some content
次のような別のマシンアクセスに問題がある場合:
[root@xxxxx] $ telnet 192.168.31.42 Trying 192.168.31.42... telnet: Unable to connect to remote host: No route to host
ファイアウォール23が開いているかどうかを確認する必要があります。
$ iptables -L -n Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:8080 ..Omit some content
ポート23を開く
iptables -I INPUT 6 -p tcp --dport 23 -j ACCEPT service iptables save iptables -L -n Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:8080 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:23 ..Omit some content
もう一度やり直してください。大丈夫です。
[root@xxxxx] $ telnet 192.168.31.42 Trying 192.168.31.42... Connected to 192.168.31.42. ..Omit some content
訂正を追加することを歓迎します