在Ubuntu中开启Telnet服务,可以按照以下步骤进行:
systemctl
命令更新系统包列表:
sudo apt update
安装Telnet服务器:
sudo apt install telnetd
启用并启动Telnet服务:
sudo systemctl enable telnet.socket
sudo systemctl start telnet.socket
检查服务状态:
sudo systemctl status telnet.socket
配置防火墙(如果需要): 如果你的系统启用了防火墙(如UFW),你需要允许Telnet流量通过。例如:
sudo ufw allow telnet
inetd
服务(适用于旧版本Ubuntu)安装inetd
:
sudo apt install inetd
启用并启动inetd
服务:
sudo systemctl enable inetd
sudo systemctl start inetd
编辑/etc/inetd.conf
文件:
打开文件并添加以下行来启用Telnet服务:
telnet stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.telnetd
重启inetd
服务:
sudo systemctl restart inetd
检查服务状态:
sudo systemctl status inetd
配置防火墙(如果需要): 同样,如果你启用了防火墙,需要允许Telnet流量通过。
通过以上步骤,你应该能够在Ubuntu系统中成功开启Telnet服务。