要在SecureCRT中配置Ubuntu SSH密钥认证,请按照以下步骤操作:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
~/.ssh/id_rsa.pub
)内容复制到SecureCRT的会话属性中。为此,请点击“Browse”按钮,然后选择本地计算机上的公钥文件。.ssh
目录,如果不存在:mkdir -p ~/.ssh
.ssh
目录中:ssh-copy-id -i ~/.ssh/id_rsa.pub username@your_server_ip
~/.ssh/authorized_keys
文件中,并确保权限设置正确:chmod 600 ~/.ssh/authorized_keys
按照以上步骤操作后,您就可以使用SecureCRT通过SSH密钥认证的方式安全地连接到Ubuntu服务器了。如果登录不成功,请检查服务器上的SSH配置文件/etc/ssh/sshd_config
,确保以下设置正确:
PubkeyAuthentication yes
RSAAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
PasswordAuthentication no
并重启SSH服务:
sudo systemctl restart sshd