zz linux建立ssh信任關係

來源:互聯網
上載者:User
建立SSH信任
將A主機做為用戶端(發起SSH請求 ip:192.168.200.170)
將B主機作為伺服器端(接收ssh請求   ip:192.168.200.149)
以上以主動發起SSH登入請求的主機和接收請求的主機進行分類
<1>A主機產生公,私密金鑰認證            
[root@buddytj-10 .ssh]#  ssh-keygen -t rsa     #rsa演算法的認證
Generating public/private rsa key pair. (以下一路斷行符號)
Enter file in which to save the key (/root/.ssh/id_rsa):    
/root/.ssh/id_rsa already exists.
Overwrite (y/n)? y                      (因為我的認證已存在,覆蓋即可)
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:
c1:26:cc:88:2b:05:dd:c3:6b:1e:78:5d:da:9c:da:8a 
認證就產生了   id_rsa (私密金鑰)|& id_rsa.pub (公開金鑰) 
<2>將A主機產生的公開金鑰傳遞給B主機 
[root@xyh .ssh]# scp id_rsa.pub  192.168.200.149:/root/.ssh/
在B主機上將A的公開金鑰更名為
[root@xyh .ssh]# mv id_rsa.pub authorized_keys 
<3>至此從A主機遠程SSH B主機的工作即告完成
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.