Linux下开启和关闭Telnet服务


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

SUSE10下

一、开启telnet服务

(1)使用命令查看已经安装的telnet包。

通常telnet包是系统默认安装的,做为客户端;telnet-server包需要自行安装,做为服务端。

(2)下载或者从安装光盘里复制相同版本的telnet-server-1.2-14.4.i586.rpm包。

安装telnet-server包,命令如下:

rpm –ivhtelnet-server-1.2-14.4.i586.rpm

安装完全后使用命令rpm –qa|greptelnet-server验证包是否安装成功。

(3)查看telnet服务是否开启,命令如下:

(4)开启telnet服务(有两种方式)

a)vi /etc/xinetd.d/telnet,将disable=yes改成disable=no;

 b)chkconfig telnet on;如果需要设置telnet服务为开机自启动,使用命令chkconfig -add telnet或者chkconfig --add telnet

(5)激活telnet服务

使用命令server xinet drestart或者/etc/init.d/xinetd restart使更改生效。

(6)测试telnet服务是否可用

二、关闭telnet服务

(1)关闭telnet服务(有两种方式)

a)vi /etc/xinetd.d/telnet,将disable=no改成disable=yes;

 b)chkconfig telnet off;如果需要设置telnet服务不为开机自启动,使用命令chkconfig -del telnet或者chkconfig --del telnet

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

(3)删除telnet-server包,命令如下:

rpm -e telnet-server--nodeps

(4)vi /etc/services,注释23号端口。

 

 

 

RedHat AS下

一、开启telnet服务

(1)使用命令查看已经安装的telnet包。

通常telnet包是系统默认安装的,做为客户端;telnet-server包需要自行安装,做为服务端。

(2)下载或者从安装光盘里复制相同版本的telnet-server-0.17-31.EL4.5.i386.rpm包。

安装telnet-server包,命令如下:

rpm –ivh telnet-server-0.17-31.EL4.5.i386.rpm

安装完全后使用命令rpm –qa|greptelnet-server验证包是否安装成功。

(3)查看telnet服务是否开启,命令如下:

(4)开启telnet服务(有两种方式)

a)vi /etc/xinetd.d/telnet,将disable=yes改成disable=no;

 b)chkconfig telnet on;如果需要设置telnet服务为开机自启动,使用命令chkconfig --add telnet

(5)vi /etc/pam.d/login文件,将第二行“auth required pam_securetty.so”注释掉(在这一行前面加#)

sxit@UNCS-PS-IMS-SV-WEB#vi /etc/pam.d/login

#%PAM-1.0

#auth      required     /lib/security/pam_securetty.so

auth       required     /lib/security/pam_stack.soservice=system-auth

auth       required     /lib/security/pam_nologin.so

account    required    /lib/security/pam_stack.so service=system-auth

password   required    /lib/security/pam_stack.so service=system-auth

session     required     /lib/security/pam_stack.soservice=system-auth

session     optional     /lib/security/pam_console.so

(6)vi /etc/securetty文件,添加登录的tty,如pts/0,pts/1,pts/2.......

sxit@UNCS-PS-IMS-SV-WEB#vi /etc/securetty

pts/0

pts/1

pts/2

vc/1

vc/2

vc/3

vc/4

(7)激活telnet服务

使用命令server xinetdrestart或者/etc/init.d/xinetdrestart使更改生效。

(6)测试telnet服务是否可用

二、关闭telnet服务

(1)关闭telnet服务(有两种方式)

a)vi /etc/xinetd.d/telnet,将disable=no改成disable=yes;

 b)chkconfig telnet off;如果需要设置telnet服务不为开机自启动,使用命令chkconfig --del telnet

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

(3)删除telnet-server包,命令如下:

rpm -e telnet-server--nodeps

(4)vi /etc/services,注释23号端口。

  • 3
    点赞
  • 29
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值