简单的telnet使用性不介绍理论

来源:互联网 发布:用的什么java工具 编辑:程序博客网 时间:2024/06/06 12:54

我们在使用telnet命令的时候

有时候会提醒telnet不是内部命令或者不能解读

(1)如果是在windows系统中很简单

在控制面板-----》小图标------》程序和功能

启动或关闭windows功能找到Telnet客户端点上对号 然后确定即ok

(2)如果是linux系统的时候

1.检查linux版本

    cat /etc/issue

2.检查是否已经安装telnet

    rpm -qa | grep telnet

[root@localhost bin]#  rpm -qa | grep telnet
telnet-server-0.17-48.el6.i686
telnet-0.17-48.el6.i686

这样已经显示已安装了就不用在安装

3.如果没有安装就要执行此步骤  在root权限下安装telnet及telnet-server

  yum install telnet

    yum install telnet-server

    等待提示是否安装,输入y然后回车,一会就装好了。

4.因为装好telnet服务之后,默认是不开启服务的,下面我们需要修改文件来开启服务。

    vi /etc/xinetd.d/telnet

    修改 disable = yes 为 disable = no

然后保存退出

5.需要激活xinetd服务(因为安装telnet-server服务启动依赖xinetd服务.xinetd超级服务为管理保护各个服务,未安装,需要首先安装。)

    service xinetd restart

    如果出现错误,就在运行一次命令:)

6.然后就需要测试telnet是否成功开启

    telnet localhost

    如果前面的操作都没问题,输入用户名密码能登录成功。

7.如果不成功,很可能是防火墙的问题了我们来修改下防火墙设置

首先,使用netstat –tunlp查看是否23端口被防火墙封掉了:

[root@localhost bin]# netstat -tunlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name   
tcp        0      0 0.0.0.0:11211               0.0.0.0:*                   LISTEN      2634/./memcached    
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1819/sshd           
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      1713/cupsd          
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      1980/master         
tcp        0      0 127.0.0.1:6010              0.0.0.0:*                   LISTEN      2260/sshd           
tcp        0      0 127.0.0.1:6011              0.0.0.0:*                   LISTEN      2651/sshd           
tcp        0      0 :::11211                    :::*                        LISTEN      2634/./memcached    
tcp        0      0 :::22                       :::*                        LISTEN      1819/sshd           
tcp        0      0 :::23                       :::*                        LISTEN      2356/xinetd         
tcp        0      0 ::1:631                     :::*                        LISTEN      1713/cupsd          
tcp        0      0 ::1:25                      :::*                        LISTEN      1980/master         
tcp        0      0 ::1:6010                    :::*                        LISTEN      2260/sshd           
tcp        0      0 ::1:6011                    :::*                        LISTEN      2651/sshd           
udp        0      0 0.0.0.0:68                  0.0.0.0:*                               1711/dhclient       
udp        0      0 0.0.0.0:11211               0.0.0.0:*                               2634/./memcached    
udp        0      0 0.0.0.0:631                 0.0.0.0:*                               1713/cupsd          
udp        0      0 :::11211                    :::*                                    2634/./memcached   

 再使用iptables修改设置,使用service iptables save保存设置,然后service iptables restart重启防火墙。

[root@localhost /]# iptables -I INPUT -p tcp --dport 23 -jACCEPT
[root@localhost /]# iptables -I INPUT -p tcp --dport 23 -jACCEPT
[root@localhost /]# service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[  OK  ]
[root@localhost /]# service iptables restart
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]
iptables: Applying firewall rules:                         [  OK  ]


由于才玩所以不知道怎么传图片 看的人辛苦啦 !!!! 毕竟是技术实用嘛



原创粉丝点击