让root可以Telnet

来源:互联网 发布:手机怎样设置网络快 编辑:程序博客网 时间:2024/04/19 07:24
让root可以Telnet
2011-09-05 09:47:46     我来说两句      
收藏    我要投稿

   Linux出于安全考虑,预设下,是不允许使用root使用进行Telnet.通常我们是使用普通帐户进行登录,需要
权限的时候再用su - 切换到root.下面通常修改/etc/securetty达到效果。以下仅供测试。
试一下使用root telnet登录
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
Kernel 2.6.18-164.el5 on an i686
login: root
Password:
Login incorrect
不允许登录
修改/etc/securetty 在里面加入 pts/0
pts/0        #在文件前面加的
console
vc/1
vc/2
再试测试
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
Kernel 2.6.18-164.el5 on an i686
login: root
Password:
Last login: Wed Dec  8 21:23:35 on tty1
Our server will be maintained at today
[root@lyy ~]#
使用root登录成功!
关于/etc/securetty
该文件可控制根用户登录的设备,该文件里记录的是可以作为根用户登录的设备名,如tty1、tty2等。用户是不能从不存在于该文件里的设备
登录为根用户的。这种情况用户只能以普通用户登录进来,再用su命令转为根用户。/etc/securetty文件的格式如下:
# /etc/securetty: list of terminals on which root is allowed to login.
# See securetty(5) and login(1).
console
# for people with serial port consoles
ttyS0
# for devfs
tts/0
# Standard consoles
tty1
tty2
tty3
...
如果/etc/securetty是一个空文件,则根用户就不能从任务的设备登录系统。只能以普通用户登录,再用su命令转成根用户。如果/etc/securetty文件不存在,那么根用户可以从任何地方登录。这样会引发安全问题,所以/etc/securetty文件在系统中是一定要存在的。

作者“Liyy学习笔记”

0 0
原创粉丝点击