CentOS允许telnet通过root用户进行访问

时间:2022-02-21 22:48:45

CentOS:

[root@clovem ~]# yum install telnet-server -y  //安装telnet服务端
[root@clovem ~]# cat /etc/xinetd.d/telnet     //开启telnet的托管服务
# default: on
# description: The telnet server serves telnet sessions; it uses \
#unencrypted username/password pairs for authentication.
service telnet
{
flags= REUSE
socket_type= stream
wait= no
user= root
server= /usr/sbin/in.telnetd
log_on_failure+= USERID
disable= no                              //将yes改为no
}
[root@clovem ~]# service xinetd restart          //重启托管服务使配置文件生效

如下操作使root用户登录生效

[root@clovem ~]# mv /etc/securetty /etc/securetty.bak

这样, root 就可以直接进入 Linux 主机了。不过,建议不要这样做。也可以在普通用户进入后,切换到root用户,拥有root的权限。

Red Hat Enterprise Linux AS release 4 

需要修改:krb5-telnet

[root@rawlnx ~]# cat /etc/xinetd.d/krb5-telnet
# default: off
# description: The kerberized telnet server accepts normal telnet sessions, \
# but can also use Kerberos 5 authentication.
service telnet
{
flags= REUSE
socket_type= stream
wait= no
user= root
server= /usr/kerberos/sbin/telnetd
log_on_failure+= USERID
disable= no
}

配置完成,重启xinetd 服务

solaris:将本文件的CONSOLE一行注释,直接生效

-bash-3.00# cat /etc/default/login |grep CONSOLE
# If CONSOLE is set, root can only login on that device.
#CONSOLE=/dev/console