默认情况下,telnet不允许root用户登陆,需要做些配置。
首先关闭防火墙和selinux。
[root@centos6 ~]# iptables -F(临时关闭防火墙)
[root@centos6 ~]#service iptables stop(永久关闭防火墙)
[root@centos6 ~]# iptables -L(查看防火墙状态)
1、安装telnet:
[root@centos6 ~]# yum install -y telnet-server telnet(服务器端及客户端都安装)
2、查看telnet端口状态是否正确:
[root@centos6 ~]# vim /etc/services(查看telnet的端口号)
telnet 23/tcp
telnet 23/udp
3、设置telnet服务状态为on:
两种方法:
[root@centos6 ~]# chkconfig telnet on
或者:
[root@centos6 ~]# cat /etc/xinetd.d/telnet
# default: on
# description: The telnet server serves telnet sessions; it uses \
# unencrypted username/password pairs for authentication.
service telnet
{
disable = yes(改成no,允许登录)
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
}
4、配置权限(亲自测试这步不需要):
[root@centos6 ~]# vim /etc/pam.d/login
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so(注释掉)
5、开通telent控制台:
在 /etc/securetty 文件最后,多添加一些pts终端入口,就可以以root用户登陆了。
[root@centos6 ~]# vim /etc/securetty
console
vc/1
vc/2
vc/3
vc/4
vc/5
vc/6
vc/7
vc/8
vc/9
vc/10
vc/11
tty1
tty2
tty3
tty4
tty5
tty6
tty7
tty8
tty9
tty10
tty11
添加以下端口即可。
pts/0
pts/1
pts/2
pts/3
pts/4
pts/5
pts/6
pts/7
pts/8
pts/9
6.重启服务
[root@centos6 ~]# service xinetd stop
[root@centos6 ~]# service xinetd start
