Centos 7 telnet 安装与配置


  • 安装 telnet 服务
yum install xinetd telnet telnet-server -y
Centos 7 telnet 安装与配置_第1张图片
telnet安装
  • 启动 telnet 服务

# 这两条命令设置开机时自动启动telnet服务
systemctl enable telnet.socket
systemctl enable xinetd
# 启动telnet服务
systemctl start telnet.socket
systemctl start xinetd
# 查看telnet服务的状态
systemctl status telnet.socket
systemctl status xinetd
Centos 7 telnet 安装与配置_第2张图片
查看telnet服务的状态
  • 防火墙开放 telnet 服务端口
cd /usr/lib/firewalld/services
vim telnet.xml

写入以下内容:



  Telnet
  Telnet is a protocol for logging into remote machines. It is unencrypted, and provides little security from network snooping attacks. Enabling telnet is not recommended. You need the telnet-server package installed for this option to be useful.
  

然后在终端键入命令:

firewall-cmd --add-service=telnet --zone=public --permanent

查看防火墙是否开放 telnet 服务端口的命令:

查看防火墙是否开放telnet服务端口

  • 关闭 telnet 服务
    由于 telnet 服务安全性低, 现在普遍都是用 ssh 远程连接, 故在必要地时候可以关闭 telnet服务:
systemctl stop telnet.socket
systemctl stop xinetd
firewall-cmd --remove-service=telnet --permanent # 防火墙不开放telnet服务端口
firewall-cmd --reload

你可能感兴趣的:(Centos 7 telnet 安装与配置)