Created
March 20, 2019 07:33
-
-
Save didinew/32a8b94ac288b0237f1e5f9fbddf0644 to your computer and use it in GitHub Desktop.
centos7 telnet 安装 与 使用
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://www.jianshu.com/p/42f6443fa717 | |
# 这两条命令设置开机时自动启动telnet服务 | |
systemctl enable telnet.socket | |
systemctl enable xinetd | |
# 启动telnet服务 | |
systemctl start telnet.socket | |
systemctl start xinetd | |
# 查看telnet服务的状态 | |
systemctl status telnet.socket | |
systemctl status xinetd | |
查看telnet服务的状态 | |
防火墙开放 telnet 服务端口 | |
cd /usr/lib/firewalld/services | |
vim telnet.xml | |
写入以下内容: | |
<?xml version="1.0" encoding="utf-8"?> | |
<service> | |
<short>Telnet</short> | |
<description>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.</description> | |
<port port="23" protocol="tcp"/> | |
</service> | |
然后在终端键入命令: | |
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 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment