在Debian系统中,开启Telnet服务需要遵循以下步骤:
systemctl
命令更新系统包列表
sudo apt update
安装Telnet服务器
sudo apt install inetd
注意:在某些Debian版本中,可能需要安装telnetd
而不是inetd
。如果inetd
不可用,可以尝试:
sudo apt install telnetd
启用并启动Telnet服务
sudo systemctl enable telnet.socket
sudo systemctl start telnet.socket
检查服务状态
sudo systemctl status telnet.socket
配置防火墙(可选)
如果你使用的是ufw
作为防火墙管理工具,需要允许Telnet端口(默认是23)的流量:
sudo ufw allow 23/tcp
sudo ufw reload
安装Telnet服务器
sudo apt install telnetd
编辑/etc/inetd.conf
文件
打开文件并找到以下行(如果没有,可以添加):
telnet stream tcp nowait root /usr/sbin/in.telnetd telnetd -l /bin/login
确保这一行没有被注释掉(即前面没有#
号)。
重启inetd
服务
sudo systemctl restart inetd
检查服务状态
sudo systemctl status inetd
配置防火墙(可选) 同方法一中的步骤5。
通过以上步骤,你应该能够在Debian系统上成功开启Telnet服务。