title: Cent OS 7.5开启telnet登录 #标题tags: telnet #标签
date: 2020-06-20
categories: linux大杂烩 # 分类

用于记录下Cent OS 7.5开启telnet登录。

  1. yum -y install telnet* xinetd
  2. cat > /etc/xinetd.d/telnet << EOF
  3. # default: yes
  4. # description: The telnet server servestelnet sessions; it uses \
  5. # unencrypted username/password pairs for authentication.
  6. service telnet
  7. {
  8. flags = REUSE
  9. socket_type = stream
  10. wait = no
  11. user = root
  12. server =/usr/sbin/in.telnetd
  13. log_on_failure += USERID
  14. disable = no
  15. }
  16. EOF
  17. systemctl restart xinetd
  18. ps -ef | grep xinetd
  19. ss -lnput | grep -w 23
  20. tcp LISTEN 0 64 :::23 :::* users:(("xinetd",pid=40820,fd=5))
  21. # 移除securetty文件以便可以root远程登录(可选配置)
  22. # 如果不移除此文件,也可以先以普通用户登录,登录后再切换至root
  23. mv /etc/securetty{,.bak}
  24. $ telnet 192.168.20.2 # 客户端使用telnet进行登录测试

登录阶段如下:

Cent OS  7.5开启telnet登录 - 图1