欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

linux - 安装 telnet-server

程序员文章站 2024-03-14 11:02:04
...

linux - 安装 telnet-server

安装 telnet-server 服务端

yum install -y telnet-server

安装 telnet 客户端

yum install -y telnet-server

启动 telent-server

# 启动 telnet-server
systemctl  start telnet.socket

# 开机启动
systemctl  enable  telnet.socket

# 状态
systemctl  status  telnet.socket

# 配置
cat /usr/lib/systemd/system/telnet.socket
[Unit]
Description=Telnet Server Activation Socket
Documentation=man:telnetd(8)

[Socket]
ListenStream=23
Accept=true

[Install]
WantedBy=sockets.target


# 防火墙规则
firewall-cmd  --zone=public  --add-port=23/tcp --permanent

查看23 端口是否启动

[[email protected] ~]# lsof -i:23
COMMAND PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
systemd   1 root   29u  IPv6 109628      0t0  TCP *:telnet (LISTEN)

客户端连接

[[email protected] ~]:~$ telnet 192.168.1.15 22
Trying 192.168.1.15...
Connected to 192.168.1.15.
Escape character is '^]'.
SSH-2.0-OpenSSH_7.4
^]
telnet> quit    # 按 ctrl + ] 进入交互
Connection closed.
相关标签: telnet