linux telnet 之 telnet: Unable to connect to remote host: Connection refused
来源:互联网 发布:淘宝设置信用卡支付 编辑:程序博客网 时间:2024/05/17 02:58
今天尝试telnet 利用 common.net 包中的 TelnetClient 来登陆linux并监控各种服务和运行脚本信息,在服务器中telnet 本机地址报错为
[root@dz_cj ~]# telnet 134.36.17.190
Trying 134.36.17.190...
telnet: connect to address 134.36.17.190: Connection refused
[root@dz_cj ~]# telnet 134.36.17.190
Trying 134.36.17.190...
telnet: connect to address 134.36.17.190: Connection refused
telnet: Unable to connect to remote host: Connection refused
1:首先查看telnet 服务是否开启:
chkconfig --list|grep telne
<span style="white-space:pre"></span>[root@dz_cj ~]# chkconfig --list|grep telnet <span style="white-space:pre"></span>ekrb5-telnet: 关闭 <span style="white-space:pre"></span>krb5-telnet: 关闭 <span style="white-space:pre"></span>telnet: 启用
1:开启: <span style="font-family: 'Courier New'; line-height: 1.5 !important;">chkconfig krb5</span><span style="font-family: 'Courier New'; line-height: 1.5 !important;">-</span><span style="font-family: 'Courier New'; line-height: 1.5 !important;">telnet on 无需开启 </span><span style="line-height: 25.2000007629395px; font-family: 'Courier New';">ekrb5-telnet 服务 -- 如果关闭的话用 </span><pre name="code" class="html" style="color: rgb(51, 51, 51); font-size: 14px; line-height: 25.2000007629395px;"><span style="font-family: 'Courier New'; line-height: 1.5 !important;"><span style="white-space:pre"></span>chkconfig krb5</span><span style="font-family: 'Courier New'; line-height: 1.5 !important;">-</span><span style="font-family: 'Courier New'; line-height: 1.5 !important;">telnet off</span>
<span style="line-height: 25.2000007629395px; font-family: 'Courier New';"><span style="white-space:pre"></span>2:激活: <span style="font-family: 'Courier New'; line-height: 1.5 !important;">chkconfig krb5</span><span style="font-family: 'Courier New'; line-height: 1.5 !important;">-</span><span style="font-family: 'Courier New'; line-height: 1.5 !important;">telnet on</span></span>
<span style="line-height: 25.2000007629395px; font-family: 'Courier New';"><span style="font-family: 'Courier New'; line-height: 1.5 !important;"></span></span>
<span style="line-height: 25.2000007629395px; font-family: 'Courier New';"><span style="font-family: 'Courier New'; line-height: 1.5 !important;"><span style="white-space:pre"></span>开启后再次进行telnet 显示为:</span></span>
<span style="line-height: 25.2000007629395px; font-family: 'Courier New';"><span style="font-family: 'Courier New'; line-height: 1.5 !important;"><span style="white-space:pre"></span></span></span><pre name="code" class="html">[root@dz_cj ~]# telnet 134.36.17.190Trying 134.36.17.190...Connected to dz_cj (134.36.17.190).Escape character is '^]'.Unencrypted connection refused. Goodbye.Connection closed by foreign host.
表示可以连接,但是这里 <span style="font-family: 'Courier New';">Unencrypted connection refused. Goodbye.</span>
<span style="font-family: 'Courier New';"></span><p style="color: rgb(51, 51, 51); font-family: tahoma, 宋体; font-size: 14px; line-height: 22.3999996185303px; text-align: justify; background-color: rgb(250, 250, 252);">1)将文件/etc/xinetd.d/ekrb5-telnet里面的参数“disable”改成:</p><p style="color: rgb(51, 51, 51); font-family: tahoma, 宋体; font-size: 14px; line-height: 22.3999996185303px; text-align: justify; background-color: rgb(250, 250, 252);">disable=yes</p><p style="color: rgb(51, 51, 51); font-family: tahoma, 宋体; font-size: 14px; line-height: 22.3999996185303px; text-align: justify; background-color: rgb(250, 250, 252);">2)重启xinetd服务:</p><p style="color: rgb(51, 51, 51); font-family: tahoma, 宋体; font-size: 14px; line-height: 22.3999996185303px; text-align: justify; background-color: rgb(250, 250, 252);">service xinetd restart</p><p style="color: rgb(51, 51, 51); font-family: tahoma, 宋体; font-size: 14px; line-height: 22.3999996185303px; text-align: justify; background-color: rgb(250, 250, 252);">3)防止系统再次更改该参数值,执行:</p><p style="color: rgb(51, 51, 51); font-family: tahoma, 宋体; font-size: 14px; line-height: 22.3999996185303px; text-align: justify; background-color: rgb(250, 250, 252);">chkconfig ekrb5-telnet off</p><p style="color: rgb(51, 51, 51); font-family: tahoma, 宋体; font-size: 14px; line-height: 22.3999996185303px; text-align: justify; background-color: rgb(250, 250, 252);"></p>搞定!
0 0
- linux telnet 之 telnet: Unable to connect to remote host: Connection refused
- linux memcached telnet 出现 Connection refused ,Unable to connect to remote host
- telnet: connect to address 127.0.0.1: Connection refused
- 【转载】telnet: connect to address 127.0.0.1: Connection refused
- telnet: connect to address 127.0.0.1: Connection refused
- telnet: connect to address 192.168.1.103: Connection refused
- telnet: connect to address 127.0.0.1: Connection refused
- telnet: connect to address 127.0.0.1: Connection refused问题
- telnet: connect to address 127.0.0.1: Connection refused解决
- telnet 安装---telnet: connect to address 127.0.0.1: Connection refused问题 ----
- Linux--ssh: connect to host localhost port 22: Connection refused
- ssh: connect to host your.remote.host.ip port 22: Connection refused
- connect to host **** port 22: Connection refused
- 阿里云安装svn失败,提示telnet: connect to address Connection refused的解决办法
- 解决telnet: connect to address 127.0.0.1: Connection refused的错误信息(2)
- TQ2440的上网设置——telnet: can't connect to remote host (166.111.8.238): No route to host
- TQ2440的上网设置——telnet: can't connect to remote host (166.111.8.238): No route to host
- [eclipse]Failed to connect to remote VM. Connection refused
- js中split函数的使用方法说明
- Android触摸事件
- AspNet MVC4 教学-11:Asp.Net MVC4 默认Authorize及自定义Authorize快速Demo
- sqlite3 not found的解决办法
- matlab cell
- linux telnet 之 telnet: Unable to connect to remote host: Connection refused
- linux下TCP/socket编程实例
- 判断三极管是否可以放大交流信号的方法
- 发现数据库查询表空间使用率语句执行的很慢
- leetcode| Happy Number
- Windows 下使用 qrencode
- 浅谈java基本类型的封装类型与对象池的概念
- Android.mk的用法和基础
- android-数据持久化之SQlite数据库存储