CentOS 7 下 Telnet 远程 root 登录
Telnet 服务 && 依赖包安装
下载安装包
https://rpmfind.net/linux/centos/7.9.2009/os/x86_64/Packages/telnet-server-0.17-65.el7_8.x86_64.rpm
https://rpmfind.net/linux/centos/7.9.2009/os/x86_64/Packages/xinetd-2.3.15-14.el7.x86_64.rpm
安装安装包
[ root@localhost ~]
warning: telnet-server-0.17-65.el7_8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing.. .
Updating / installing.. .
1 :telnet-server-1:0.17-65.el7_8
[ root@localhost ~]
warning: xinetd-2.3.15-14.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing.. .
Updating / installing.. .
1 :xinetd-2:2.3.15-14.el7
配置 && 启动服务
关闭防火墙
[ root@localhost ~]
[ root@localhost ~]
关闭 SELinux
[ root@localhost ~]
修改安全文件
[ root@localhost ~]
pts/0
pts/1
EOF
修改 pam 模块 telnet 权限
[ root@localhost ~]
auth required pam_securetty.so
[ root@localhost ~]
配置 telnet-server 参数
[ root@localhost ~]
service telnet
{
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
disable = no
}
EOF
启动 telnet-server
[ root@localhost ~]
启动 xinetd
[ root@localhost ~]
验证 root 通过 telnet 远程登陆
验证 telnet 服务状态
[ root@localhost ~]
● telnet.socket - Telnet Server Activation Socket
Loaded: loaded ( /usr/lib/systemd/system/telnet.socket; disabled; vendor preset: disabled)
Active: active ( listening) since Wed 2022 -11-02 19 :04:00 CST; 26s ago
Docs: man:telnetd( 8 )
Listen: [ ::] :23 ( Stream)
Accepted: 0 ; Connected: 0
验证 xinetd 服务状态
[ root@localhost ~]
● xinetd.service - Xinetd A Powerful Replacement For Inetd
Loaded: loaded ( /usr/lib/systemd/system/xinetd.service; enabled; vendor preset: enabled)
Active: active ( running) since Wed 2022 -11-02 19 :04:06 CST; 1min 1s ago
Process: 1739 ExecStart = /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid $EXTRAOPTIONS ( code= exited, status = 0 /SUCCESS)
Main PID: 1740 ( xinetd)
CGroup: /system.slice/xinetd.service
└─1740 /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid
验证 telnet 端口
[ root@localhost ~]
LISTEN 0 128 [ ::] :23 [ ::] :* users:(( "systemd", pid= 1 , fd= 26 ))
验证 root 通过 telnet 登录
[ C:\ ~] $ telnet 192.168 .68.129
Connecting to 192.168 .68.129:23.. .
Connection established.
To escape to local shell, press 'Ctrl+Alt+]' .
Kernel 3.10 .0-1127.el7.x86_64 on an x86_64
localhost login: root
Password:
Last login: Wed Nov 2 19 :02:11 from 192.168 .68.1
参考