在Debian系统中开启Telnet服务,可以按照以下步骤进行:
更新软件包列表
sudo apt update
安装Telnet服务器
sudo apt install inetd xinetd
启用并启动Telnet服务
/etc/xinetd.d/telnet
文件:sudo nano /etc/xinetd.d/telnet
service telnet
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
}
重启xinetd服务以应用更改
sudo systemctl restart xinetd
验证Telnet服务是否运行
sudo netstat -tulnp | grep telnet
或者使用telnet
命令测试连接:
telnet localhost 23
确保inetd已安装
sudo apt install inetd
编辑inetd配置文件
sudo nano /etc/inetd.conf
telnet stream tcp nowait root /usr/sbin/in.telnetd telnetd
重启inetd服务
sudo systemctl restart inetd
验证Telnet服务是否运行 同方法一中的步骤5。
ufw
或iptables
进行配置。如果使用ufw
作为防火墙管理工具,可以执行以下命令:
sudo ufw allow 23/tcp
然后重新加载防火墙规则:
sudo ufw reload
通过以上步骤,你应该能够在Debian系统中成功开启Telnet服务。