在Ubuntu系統中使用SecureCRT進行密鑰認證的步驟如下:
~/.ssh/id_rsa.pub
)。Identity.pub
)上傳到Ubuntu服務器的~/.ssh/
目錄下。如果沒有該目錄,請手動創建它。chmod 600 ~/.ssh/Identity.pub
。/etc/ssh/sshd_config
文件進行編輯。PubkeyAuthentication yes
:啟用公鑰認證。RSAAuthentication yes
:如果使用RSA密鑰對進行認證,也需要啟用此選項。AuthorizedKeysFile .ssh/Identity.pub
:指定公鑰文件的位置。PasswordAuthentication no
。sshd_config
文件。sudo systemctl restart sshd
。如果在連接過程中遇到“No compatible hostkey/key exchange method”錯誤,可以嘗試以下解決方法:
/etc/ssh/sshd_config
文件,添加或修改以下配置項:HostKeyAlgorithms=+ssh-rsa,ssh-dss
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
sudo systemctl restart sshd.service
。通過以上步驟,您應該能夠在Ubuntu系統中成功配置SecureCRT進行密鑰認證。如果在配置過程中遇到任何問題,請檢查每一步的配置是否正確,并確保密鑰文件的權限設置正確。