Linux下开启和关闭Telnet服务
2015-10-02 18:41
791 查看
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号端口。
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号端口。
相关文章推荐
- linux文件处理命令——文件处理命令
- Linux - 扩展
- Linux GCC常用命令
- Linux内核源码分析之文件系统(1) -- 三思而后行
- NCL介绍与安装 记一次不平凡的经历!
- 关于Linux权限问题(由samb访问所引起的)
- 虚拟机中CentOS自动获取ip和静态ip设置
- Vs2012于Linux应用程序开发(2):图案
- Linux 命令 - tail: 打印文件的结尾部分
- Linux 命令 - head: 打印文件的开头部分
- linux文件处理命令——目录处理命令
- Linux基本命令(1)
- Linux查看和杀死进程
- linux(ubuntu)中一些特殊符号
- Linux 命令 - uniq: 通知或忽略重复行
- Linux安装与配置samb服务器的过程以及遇到的问题
- 如何在Linux上使用netstat命令查证DDOS攻击
- Centos6.5下一个Ceph存储集群结构
- Set Up VTune Amplifier(windows) 2015 for Remote (linux)Analysis
- linux下文件的特殊权限s和t