使用公钥认证通过SecureCRT登录SSH服务器是一种非常安全的方法,可以显著提高远程访问的安全性。以下是详细的步骤:
Quick Connect -> Authentiation -> Public Key -> Properties -> Create Identity File。Identity.pub。cat 命令查看公钥内容:cat ~/.ssh/Identity.pub。~/.ssh/authorized_keys 文件中。可以通过以下命令完成此操作:ssh-copy-id user@remote_host "cat >> ~/.ssh/authorized_keys"
其中 user 是远程服务器上的用户名,remote_host 是远程服务器的地址。Connection -> SSH -> Authentication。Method 下拉菜单中选择 Public Key。Browse 按钮,选择本地保存的私钥文件(通常是 ~/.ssh/Identity)。OK 保存设置。~/.ssh 目录,并且权限设置正确:mkdir /root/.ssh
chmod 700 /root/.ssh
Identity.pub 转换为OpenSSH兼容格式(如果尚未转换):ssh-keygen -i -f Identity.pub >> /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys
/etc/ssh/sshd_config,确保以下设置:PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
PasswordAuthentication no
service sshd restart
完成以上步骤后,您应该能够通过密钥认证方式安全地连接到远程服务器。请确保私钥的安全,不要将其泄露给他人。