linux telnet 服务开启


今天公司有个同事弄了个Red Hat Enterprise 5装,系统装好后,发现telnet不能用,ssh是可以的。搞了好久,才给搞定,结合以前摘下的关于这方面的资料,参考如下:

    1。概述linux提供服务是由运行在后台的守护程序(daemon)来执行的。

    守护进程的工作就是打开1个端口(port),等待(listen)进入的连接。在C/S模式中,如果客户提请了1个连接,守护进程就创建(fork)子进程来响应这个连接,而父进程继续监听其他服务的请求。

    但 是,对于系统所提供的每1个服务,如果都必须运行1个监听某个端口连接发生的守护程序,那么通常意味着系统资源的浪费。为此,引入“扩展的网络守护进程服 务程序”xinetd(xinetd internet daemon)。telnet服务也是由xinetd守护的。

    2。检测telnet、telnet-server的rpm包是否安装

    OS:RedHat9

    [root@localhost root]#rpm -qa telnet

    telnet-0.17-25 //telnet*.rpm是默认安装的//

    [root@localhost root]#rpm -qa telnet-server

    空

    //telnet*.rpm是默认没有安装的//

    3。安装telnet-server第3张盘上有telnet-server-0.17-25.i386.rpm [root@localhost root]#rpm -ivh telnet-server*.i386.rpm  --这个软件包依赖于xinet这个包。

    4。修改telnet服务配置文件vi /etc/xinetd.d/telnet

    service telnet

    {

    disable = yes

    flags = REUSE

    socket_type = stream

    wait = no

    user = root

    server = /usr/sbin/in.telnetd

    log_on_failure += USERID

    }

    将disable=yes行前加#,或者改为disable=no

    PS:

    安装telnet-server后,系统才有文件/usr/sbin/in.telnetd

    5。重新启动xinetd守护进程由于telnet服务也是由xinetd守护的,所以安装完telnet-server,要启动telnet服务就必须重新启动xinetd

    [root@localhost root]#service xinetd restart

    或

    [root@localhost root]#/etc/init.d/xinetd restart

    6。关闭系统的防火墙,如果不能修改,则先修改下用户认证方式再试试(setup ->  Authentication configuration) linux系统默认的防火墙是“high”

    命令行界面CLI:

    [root@localhost root]# setup

    选择:“firewall configuration”

    选择:security level——“no firewall”
 7。设置root用户可以telnet主机(生产环境下不建议这样) # vi /etc/securetty  添加pts/0,要控制root同时telnet数量,就添加多少个pts/x,其中x为0-255-...的数字。示例如下:

    # cat /etc/securetty

    console

    vc/1

    vc/2

    vc/3

    vc/4

    vc/5

    tty1

    tty2

    tty3

    tty4

    tty5

    tty6

    pts/0

    pts/1

    pts/2

    pts/3

    8。测试

    c:> telnet IP

    Trying...

    Connected to IP

    Escape character is '^]'.

    Red Hat Enterprise Linux Server release 5 (Tikanga)

    Kernel 2.6.18-8.el5 on an i686

    login:

    9。telnet默认开机启动1)。命令ntsysv找到telnet,用空格键激活(*)服务2)。命令chkconfig

    chkconfig --add telnet

    chkconfig telnet on

    3)。图形用户界面GUI

    redhat-conhat-config-services

    或

    “主菜单”——“系统设置”——“服务器设置”——“服务”

    PS:

    由于telnet登陆时是明文传送密码,所以不安全,建议使用ssh(secure shell)替代!

    windows下一般用F-Secure SSH ,putty SSH

    10。Trouble Shooting

    (1).我在我机子上输入 telnet 192.168.1.18 (装有Fedora Core 6 系统的机器)

    dos提示:

    Unencrypted connection refused.Goodbye.

    失去了跟主机的连接

    解决参考:

    "Unencrypted connection refused,Goodbye"解决办法:因为开启的Telnet server为/etc/xinetd.d/ekrb5-telnet所以修改ekrb5-telnet项目disable=yes即可.重启服务service inetd restart即可.

    (2).red hat linux enterprise 5 在从别的机上telnet  过去时出现如下错误:(发出命令为: telnet 10.x.x.x)

    getnameinfo: localhost: Success

    Temporary failure in name resolution: Illegal seek

    失去了跟主机的连接。

    网上说只要在你的red hat linux enterprise 5的host文件中增加telnet客户端的地址,例如10.200.1.130 clientmachine,但是加了也不行,解决参考如下:分析原因是red hat 5的用户认证鉴权方式比较严格,且也不能修改Firewall 的设置,只要把 Authentication configuration 里的一些选项去掉便可。

    # setup

    选择 Authentication configuration 去掉一些认证方式,然后再修改Firewall configuration里设置。


« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3