windows 上用xshell使用 ssh自動登錄linux
說明:今天來了一個小夥伴,因為業務需要,要登錄一臺測試系統,問我密碼是多少,我說我配置的密鑰登錄的,估計他不太熟悉,所以我簡單的演示了一下配置過程給他看,順便也記錄了下整個配置過程。
1、關於密鑰登錄系統的原理
關於配置原理,可以參考https://help.aliyun.com/knowledge_detail/41493.html,現在阿裏雲的官方文檔寫的很詳細,我也不想粘貼復制了。
2、服務端的配置過程
a)生成密鑰對(這裏我只是做個測試,所以一路回車就好了)
[[email protected] ~]# ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Created directory ‘/root/.ssh‘. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: ce:6a:a7:fc:e6:d4:f4:21:98:5c:3b:f1:03:01:9d:7a [email protected]
b)查看密鑰的位置(默認存在家目錄的.ssh下)*:
[[email protected]