| 加固项 | 未授权访问警告 |
|---|---|
| 适用平台 | Linux(RHEL/CentOS/Debian/Ubuntu) |
| 风险等级 | 低 |
| 文件 | /etc/issue、/etc/issue.net + sshd Banner 指令 |
配置横幅并挂到 SSH
配置横幅并挂到 SSH
cat > /etc/issue <<'EOF'
WARNING: Authorized access only. All activity is monitored and logged.
Unauthorized access will be prosecuted.
EOF
cp /etc/issue /etc/issue.net
grep -q '^Banner' /etc/ssh/sshd_config || echo 'Banner /etc/issue.net' >> /etc/ssh/sshd_config
sshd -t && systemctl reload sshd横幅只写警告语,不要包含主机名、系统版本、联系方式等敏感信息——横幅本身不应成为情报来源。