1. 系统级基础安全加固
apt update && apt upgrade,确保Debian系统及SecureCRT为最新版本,及时修补已知安全漏洞。useradd -m username),并将其加入sudo组(usermod -aG sudo username),通过sudo执行特权命令。ufw(推荐)或iptables限制访问,仅开放必要端口(如SSH的22端口、HTTP的80端口),例如ufw allow 22/tcp,并启用防火墙(ufw enable)。2. SSH服务安全配置(关键前提)
/etc/ssh/sshd_config,设置PermitRootLogin no,禁止root用户通过SSH直接登录,降低被暴力破解的风险。sshd_config中设置PasswordAuthentication no,强制使用SSH密钥认证,避免密码被穷举攻击。Port 50022),减少自动化扫描工具的攻击概率(需同步更新SecureCRT会话配置中的端口)。PermitEmptyPasswords no,禁止使用空密码的用户登录,增强账户安全性。3. SecureCRT自身安全设置
ssh-keygen -t rsa -b 4096(推荐4096位密钥),生成私钥(id_rsa)和公钥(id_rsa.pub)。~/.ssh/authorized_keys文件中(ssh-copy-id username@server_ip),或在SecureCRT会话选项中直接导入公钥。~/.ssh/id_rsa),并勾选“Attempt authentication using keyboard-interactive”(可选)。aes256-ctr、chacha20-poly1305@openssh.com),禁用弱算法(如3des、arcfour);设置MAC算法为hmac-sha2-256或更高版本。~/.securecrt/logs/)和文件名格式(如%SESSIONNAME%_%Y%m%d.log),开启“Append to existing log file”(追加日志),便于后续审计操作历史。4. 高级安全增强措施
/etc/pam.d/sshd,添加auth required pam_tally2.so deny=5 unlock_time=300(5次失败后锁定300秒),限制暴力破解尝试;可通过faillog -a查看失败记录,pam_tally2 -u username重置失败计数。/etc/ssh/sshd_config中添加AllowUsers username@trusted_ip(如AllowUsers admin@192.168.1.100),仅允许指定IP地址的用户登录,进一步提升安全性。~/.securecrt/目录(包含会话配置、密钥、日志等)备份到安全位置(如加密U盘或远程存储),防止配置丢失或泄露。