侧边栏壁纸
博主头像
知我隧道博主等级

一个被程序员生涯耽误的UI设计师

  • 累计撰写 23 篇文章
  • 累计创建 10 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

CentOS开启telnet服务

kongbai121
2023-11-01 / 0 评论 / 0 点赞 / 32 阅读 / 2328 字 / 正在检测是否收录...

一、安装telnet-server

yum install telnet-server

二、启动telnet服务

#编辑 /etc/xinetd.d/telnet
vim /etc/xinetd.d/telnet
​
# 将 disable = yes 的yes改为no.
service telnet
{
        flags           = REUSE
        socket_type     = stream
        wait            = no
        user            = root
        server          = /usr/sbin/in.telnetd
        log_on_failure  += USERID
        disable         = yes
}

三、重启xinetd服务

service xinetd restart

四、开启telnet的root用户登录(可选)

# 修改/etc/pam.d/remote 
vim /etc/pam.d/remote 
​
# 注释auth required pam_securetty.so
#%PAM-1.0
#auth       required     pam_securetty.so
auth       include      system-auth
​

五、尝试登录

# 使用另一台linux登录 直接telnet ip
telnet xxx.xxx.xxx.xxx
​
# 使用可视化连接工具
# 直接选择连接方式为telnet 然后输入账号密码登录
​

六、可能遇到的问题

# 如果确保telnet服务端和客户端都是正常的 防火墙关闭或已开通对应端口(默认23) 且账号密码都说如正确的情况下 登录提示 Login incorrect
​
# 查看telnet日志
tail /var/log/secure
# 可以看到类似的日志
login: pam_securetty(remote:auth): access denied: tty 'pts/1' is not secure !
login: FAILED LOGIN 1 FROM 172.23.1.200 FOR root, Authentication failure
# 注意这个tty 'pts/1'中的''里的值(这里是pts/1)
​
# 在/etc/securetty文件中允许这个tty设备登录
vim /etc/securetty
# 在文件中的最后一行加上 pts/1
pts/1
​
# 保存后重新尝试登录
​


0

评论区