保障远程登录安全 · 及时应对高危漏洞
OpenSSH(Open Secure Shell)是一套用于安全远程登录和文件传输的开源工具集,广泛应用于 Linux、Unix 和 macOS 系统中。由于其核心地位,一旦出现安全漏洞,可能被攻击者利用进行未授权访问、提权或数据窃取。
sudo apt update && sudo apt upgrade openssh-server # Debian/Ubuntu sudo yum update openssh-server # CentOS/RHEL
编辑 /etc/ssh/sshd_config,确保以下设置:
Protocol 2 PermitRootLogin no PasswordAuthentication no PubkeyAuthentication yes Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com
AllowUsers your_username DenyUsers root,admin
sudo apt install fail2ban sudo systemctl enable --now fail2ban
/var/log/auth.log 或 /var/log/secure 中的异常登录行为。ssh -V 检查客户端版本,sshd -V(部分系统需查看日志)确认服务端版本。nmap --script ssh2-enum-algos target)检测弱算法是否已禁用。/etc/ssh/ 目录配置