在 Linux 下使用 SecureCRT 配置 密钥登录(SSH Key 认证),通常分为两部分:
下面按步骤说明(以常见的 RSA / ED25519 为例)。
ssh-keygen -t rsa -b 4096
# 或(推荐)
ssh-keygen -t ed25519
~/.ssh/id_rsa~/.ssh/id_rsa.pubssh-copy-id user@server_ip
或手动追加到服务器:
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
SecureCRT(较新版本)支持 OpenSSH 格式私钥。
Connection → SSH2
/home/youruser/.ssh/id_rsa
✅ 无需转换格式,最简单
如果你不想用 OpenSSH 密钥:
Tools → Create Public Key
.pub 和私钥SecureCRT 生成的 .pub 是 RFC4716 格式,需要转换:
ssh-keygen -i -f securecrt.pub >> ~/.ssh/authorized_keys
确保 /etc/ssh/sshd_config 中:
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
修改后重启:
systemctl restart sshd
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
chmod 600 ~/.ssh/id_rsa
tail -f /var/log/secure
✅ 最简单方案
Linux 生成 OpenSSH 密钥 → SecureCRT 直接选私钥文件
如果你愿意,可以告诉我:
我可以给你更精确的配置示例。