Debian服务器可通过以下方式控制Telnet访问权限,同时建议优先使用SSH替代:
sudo iptables -A INPUT -p tcp --dport 23 -s 允许的IP -j ACCEPTsudo iptables -A INPUT -p tcp --dport 23 -j DROPsudo ufw allow from 允许的IP to any port 23sudo ufw deny 23/etc/hosts.allow和/etc/hosts.deny,通过IP或主机名控制访问。
in.telnetd: 192.168.1.100in.telnetd: ALL/etc/inetd.conf,通过server_args参数限制登录用户(需配合tcpd)。sudo systemctl stop inetd && sudo systemctl disable inetdsudo apt install openssh-server,配置/etc/ssh/sshd_config后重启服务。注意:Telnet传输数据为明文,存在安全风险,建议仅在测试环境使用,生产环境务必替换为SSH。