四、客户端访问实验

基础由于LINUX为了提高TELNET的安全性和防止未授权的用户利用TELNET的BUG

下面我们来看一下二种错误:

第一种:

  1. [root@linuxchao ~]# telnet 192.168.1.87  
  2. Trying 192.168.1.87...  
  3. telnet: connect to address 192.168.1.87: No route to host  
  4. telnet: Unable to connect to remote host: No route to host 

解决方法:这种问题防火墙没有允许telnet服务,连接被阻止,默认CentOS只允许SSH,所以进入其自定义选项,在telnet前打个勾!

第二种

  1. [root@test xinetd.d]# telnet 172.25.1.3  
  2. Trying 172.25.1.3...  
  3. Connected to 172.25.1.3 (172.25.1.3).  
  4. Escape character is '^]'.  
  5. getnameinfo: localhost: Success  
  6. Temporary failure in name resolution: Illegal seek  
  7. Connection closed by foreign host. 

这一个就是/etc/hosts文件配置问题

解决方法:我在里面加两个IP地址,内容如下:

  1. [linuxchao@localhost ~]$ more /etc/hosts  
  2. # Do not remove the following line, or various programs  
  3. # that require network functionality will fail.  
  4. 127.0.0.1localhost.localdomainlocalhost  
  5. ::1localhost6.localdomain6localhost6  
  6. 192.168.1.88  
  7. 192.168.1.86 

说明:因为客户机的名字不好记就没写进去,内容格式应为 127.0.0.1 pcname

总结:在使用telnet时要记得1.打开防火墙对telnet的限制2./etc/hosts对客户机的限制3.注意/etc/hosts.allow与/etc/hosts.deny两个文件

里的内容,都有可能会限制访问,这里只是局域网测试就不说多了.


相关内容