茫茫網海中的冷日
         
茫茫網海中的冷日
發生過的事,不可能遺忘,只是想不起來而已!
 恭喜您是本站第 1672206 位訪客!  登入  | 註冊
主選單

Google 自訂搜尋

Goole 廣告

隨機相片
IMG_60D_00274.jpg

授權條款

使用者登入
使用者名稱:

密碼:


忘了密碼?

現在就註冊!

小企鵝開談 : [分享]如何免用密碼登入ssh伺服器?

發表者 討論內容
冷日
(冷日)
Webmaster
  • 註冊日: 2008/2/19
  • 來自:
  • 發表數: 15771
[分享]如何免用密碼登入ssh伺服器?
如何免用密碼登入ssh伺服器?
雖然說應該已經很老生常談了, 但是為了怕我自己忘掉. 註記一下.

我是參考這篇文章的:

Getting started with SSH - Kimmo Suominen

首先, 你需要確定已經在兩台機器上都已經安裝了ssh, 而且被登入的那台已經執行sshd, 可以被登入了.

接下來, 在local執行以下指令產生dsa key:
[code:1:5c99c7d84a]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/jouston/.ssh/id_rsa): [RETURN]
Enter passphrase (empty for no passphrase): [RETURN]
Enter same passphrase again: [RETURN]
Your identification has been saved in /home/jouston/.ssh/id_rsa.
Your public key has been saved in /home/jouston/.ssh/id_rsa.pub.
The key fingerprint is:
aa:aa:aa:......:aa jouston@jouston.no-ip.com[/code:1:5c99c7d84a]

基本上只需要連續按幾次[RETURN](就是鍵盤的[ENTER]鍵)

好了, 我們做到這一步已經弄到key了. 接下來需要把dsa.pub複製到遠端的伺服器:

[code:1:5c99c7d84a]# scp ~/.ssh/dsa.pub 10.1.1.1:.ssh/authorized_keys[/code:1:5c99c7d84a]
搞定收工.

另外, 如果有多台機器要這樣免密碼登入的話, 你可以把後來的key在遠端機器那裡這麼作:

[code:1:5c99c7d84a]# cat dsa.pub >> authorized_keys[/code:1:5c99c7d84a]

直接附加上去就可以了
前一個主題 | 下一個主題 | | | |

討論串




Powered by XOOPS 2.0 © 2001-2008 The XOOPS Project|