Chinaunix首页 | 论坛 | 博客
  • 博客访问: 673982
  • 博文数量: 96
  • 博客积分: 2005
  • 博客等级: 上尉
  • 技术积分: 1061
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-21 13:59
文章分类

全部博文(96)

文章存档

2013年(11)

2012年(30)

2011年(55)

分类: LINUX

2012-12-06 15:56:48

CentOS5.8上安装telnet服务

1.查看系统版本及是否安装telnet
  1. [root@centos32 comodo]# cat /etc/issue
  2. CentOS release 5.8 (Final)
  3. Kernel \r on an \m
  4. [root@centos32 comodo]# rpm -qa|grep telnet
  5. telnet-0.17-39.el5
其中CentOS系统默认已经安装了telnet,但是telnet-server软件包需要自行安装

2.安装telnet-server
1.可以下载rpm包安装(下载地址:)
2.可以#yum install telnet-server
安装完成后检查安装是否成功:
  1. [root@centos32 comodo]# rpm -qa|grep telnet
  2. telnet-0.17-39.el5
  3. telnet-server-0.17-39.el5
3.启动telnet服务
方法1:图形桌面System->Administration->Services->"On Demand Services"菜单页选中telnet并保存
方法2:图形桌面Applications->Accessories->Terminal中输入#/usr/sbin/ntsysv回车选中telnet并保存
方法3:修改/etc/xinetd.d/telnet将disable = yes修改为no, 可以使用命令#sed -i 's/disable = yes/disable = no/' /etc/xinetd.d/telnet
方法4:修改启动项#/sbin/chkconfig telnet on
方法3和方法4需要重启telnet服务,运行命令#/etc/rc.d/init.d/xinetd restart

4.测试服务
  1. [root@centos32 comodo]# telnet localhost
  2. Trying 127.0.0.1...
  3. Connected to localhost.localdomain (127.0.0.1).
  4. Escape character is '^]'.
  5. CentOS release 5.8 (Final)
  6. Kernel 2.6.18-308.16.1.el5 on an i686
  7. login: comodo
  8. Password:
  9. Last login: Thu Dec 6 15:19:27 from debian32
  10. [comodo@centos32 ~]$ exit(此处可知telnet已经使用用户comodo成功登录)
  11. logout
  12. Connection closed by foreign host.
  13. [root@centos32 comodo]#

5.允许root登录telnet(默认情况下,telnet禁止root用户登录)
方法1.修改/etc/pam.d/remote注释掉auth required pam_securetty.so
  1. [root@centos32 comodo]# vim /etc/pam.d/remote
  2. #%PAM-1.0
  3. #auth required pam_securetty.so
方法2.先查看root登录使用的伪终端号,然后把这个伪终端加到/etc/securetty中
step 1:打开一个终端输入
  1. [root@centos32 comodo]# telnet localhost
  2. Trying 127.0.0.1...
  3. Connected to localhost.localdomain (127.0.0.1).
  4. Escape character is '^]'.
  5. CentOS release 5.8 (Final)
  6. Kernel 2.6.18-308.16.1.el5 on an i686
  7. login: root
  8. Password:
  9. Login incorrect
  10. login: Login timed out after 60 seconds
  11. Connection closed by foreign host.
step 2:打开一个终端输入
  1. [root@centos32 comodo]#tail /var/log/secure
  2. Dec 6 15:51:15 centos32 login: pam_securetty(remote:auth): access denied: tty 'pts/7' is not secure !
  3. Dec 6 15:51:18 centos32 login: FAILED LOGIN 1 FROM centos32 FOR root, Authentication failure
step 3:把pts/7加入到/etc/securetty后,telnet即可使用root账户登录
  1. [root@centos32 comodo]# vim /etc/securetty
  2. pts/7


阅读(9609) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~