Debian 上使用 SecureCRT 配置 SSH 的完整步骤
一 环境准备
二 在 Debian 上启用 SSH 服务
sudo apt update && sudo apt install -y openssh-serverPort 22(或自定义端口)PermitRootLogin no(生产环境建议禁用 root 直登)PasswordAuthentication yes(若先用密码验证,后续可改为 no 仅用密钥)X11Forwarding yes(如需图形转发)sudo systemctl restart ssh(或 sudo service ssh restart)sudo ufw allow 22/tcpsudo nft add rule inet filter input tcp dport 22 acceptssh-keygen -t rsa -b 4096ssh-copy-id user@your_debian_host,或手动将公钥追加到远端 ~/.ssh/authorized_keys。三 在 SecureCRT 中创建并配置 SSH 会话
~/.ssh/authorized_keys 放置对应公钥。四 连接测试与常见问题
ssh user@your_debian_host -p 22,确认网络与认证正常,再在 SecureCRT 中连接。ss -tlnp | grep :22)与云安全组/本机防火墙已放行。sudo systemctl status ssh,异常时查看日志 sudo journalctl -u ssh -xe。~/.ssh 目录权限应为 700,authorized_keys 为 600,否则公钥登录会被拒绝。PasswordAuthentication no 后仍能用私钥登录。五 安全与运维建议