Debian下Telnet安全设置技巧如下:
sudo systemctl stop telnet.socket
sudo systemctl disable telnet.socket
sudo apt install openssh-server
sudo nano /etc/ssh/sshd_config # 修改以下配置:
PermitRootLogin no
PubkeyAuthentication yes
PasswordAuthentication no
sudo ufw deny 23/tcp
sudo ufw enable
/etc/hosts.allow
和/etc/hosts.deny
。/etc/pam.d/login
,注释pam_securetty.so
行。注意:Telnet因明文传输存在固有安全风险,建议仅在测试环境使用,生产环境务必采用SSH。