發表於: 週二, 八月 19, 2008

標籤: ,

目 的: sitea 使用 ssh 連至 siteb 時不提示密碼

本地端: sitea.com.tw (sitea)
遠 端: siteb.com.tw (siteb)

在 sitea 使用 ssh-keygen 建立共用/私有金鑰

[root@sitea ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
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:
5e:8c:33:a6:60:44:fd:63:fc:f6:03:c6:43:74:65:ca root@sitea.com.tw

將 sitea 的共用金鑰傳送至 siteb

[root@sitea .ssh]# scp id_rsa.pub avai@siteb.com.tw:~/id_rsa.pub
id_rsa.pub 100% 239 0.2KB/s 00:00
[root@sitea .ssh]#

使用 ssh 連入 siteb 設定共用金鑰

[root@sitea .ssh]# ssh avai@siteb.com.tw
avai@siteb.com.tw’s password:
[avai@siteb ~]$ mkdir .ssh
[avai@siteb ~]$ mv id_rsa.pub .ssh/authorized_keys
[avai@siteb ~]$ exit

再次使用 ssh 連至 siteb 就不會再提示密碼了

[root@sitea ~]# ssh avai@siteb.com.tw
Last login: Fri May 30 22:30:00 2008 from xx-xx-xx-xx.sitea-ip.com.tw
[avai@siteb ~]$


好文推介:
  • Hemidemi
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Haohao
  • Live
  • N4G
  • MyShare
  • Technorati

相關文章

本篇文章的作者為:

A`Vai Poitsonu - 共發表了 117 篇文章於 骯髒園丁的工寮.


聯絡作者

blog comments powered by Disqus

關於園丁

暱稱 》骯髒園丁|
星座 》獅子座|
興趣 》音樂|電影|網路|

■■喜歡胡思亂想的大男生,鐘情自然、熱愛淋雨,常會認為自己是從地底洞穴移居到地表的爬蟲動物。目前定居在骯髒工寮內,寫自己喜歡說的事情。

■■如果有事,你可以在進入雅虎森林之後,將信件投遞至上面刻著 poitsonu(a)yahoo.com 的巨石後方,自然就有精靈差使會將信送到我這裡 …

推特園丁

文章彙整

藏書隨選

尷尬網誌寫作者互助協會 尷尬聯播網

文章分類

SEO Powered by Platinum SEO from Techblissonline