Linux 系统Telnet服务

Linux 系统Telnet服务

  telnet与ssh相比,安全性能并不高,但是在ssh版本升级或者其他的情况下还是需要开启这一项服务。linux提供服务是由运行在后台的守护进程daemon来执行的,telnet服务是由xinetd守护的。

  开启telnet服务:

  1、检查telnet是否已经安装。

  2、查看telnet服务是否开启,

  命令:chkconfig --list | grep telnet

  3、开启telnet服务

  方法一:vi /etc/xinetd.d/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

  4、重新启动xinetd守护进程

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

  5、关闭防火墙

1) 重启后生效 
开启: chkconfig iptables on 
关闭: chkconfig iptables off 

2) 即时生效,重启后失效 
开启: service iptables start 
关闭: service iptables stop 

  6、如果想允许以root身份登录telnet

  vi /etc/pam.d/login

在 auth required /lib/security/pam_securetty.so 这行前加 # ,即把这行注释掉就行

关闭telnet服务

(1)法一:vi /etc/xinetd.d/telnet 将distable = no 改成 disable = yes

    法二:chkconfig telnet off 如果需要设置telent服务不为开机自启动,使用命令chkconfig --del telnet

(2)使用命令service xinetd restart或者/etc/init.d/xinetd restart是更改生效

 删除telnet-server包:RPM -e telnet-server --nodeps      注释23端口: vi /etc/service.

猜你喜欢

转载自www.linuxidc.com/Linux/2016-03/128790.htm