分享

SSH 免密碼登入 快速三步驟

 农夫子oice 2007-04-29

SSH 免密碼登入 快速三步驟

被登入的主機當 Server,自己的當 Client

Step1 : 在 Client 端建立 Public 與 Private Key


$ssh-keygen -t dsa <==這個步驟產生 Keys
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa): <== 按下 Enter
Enter passphrase (empty for no passphrase): <== 按 Enter
Enter same passphrase again: <== 再按一次 Enter
Your identification has been saved in /root/.ssh/id_dsa. <== 私鑰
Your public key has been saved in /root/.ssh/id_dsa.pub. <== 公鑰
The key fingerprint is:
c4:ae:d9:02:d1:ba:06:5d:07:e6:92:e6:6a:c8:14:ba test@test.com


Step2 : 在 Server 端放置 Client 可以登入的公鑰


$cd ~/.ssh
$scp id_dsa.pub root@192.168.1.1:~/


Step3 : 登入到 Server 端,將公鑰轉存到 authorized_keys 檔案中


$ssh 192.168.1.1
$cat id_dsa.pub >> .ssh/authorized_keys


Ya!!! 大功告成! That‘s it!!!
 

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多