兩機之間不用密碼傳輸檔案(轉)

post0發表於2007-08-11
兩機之間不用密碼傳輸檔案(轉)[@more@]

首先假定有兩臺linux機器,linux1和linux2。 你想從linux1向linux2複製機器時無需輸入密碼,或者是在ctontab中這樣做。

1. 安裝SSH

2. 建立兩個使用者,user1在linux1上,user2吱在linux2上。

3. On linux2, login as user2. do

ssh-keygen -P "" -trsa1 -f ~/.ssh/identity

4. Copy key file to linux1

scp /home/user2/.ssh/identity.pub user1@linux1:/home/user1/.ssh/authorized_keys

5. Change file permission

chmod 600 /home/user2/.ssh/authorized_keys

6. change ssh config file: /etc/ssh/ssh_config

Ad

Host *

ForwardX11 yes

IdentityFile ~/.ssh/identity

Protocol 1

7. Restart sshd

8. login to linux1 as user1.

9.Change file permission

chmod 600 /home/user1/.ssh/identity

10. Restart sshd

Now, you can ssh or secure copy filles by using user1 from linux1 to linux2 without promp

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8225414/viewspace-946268/,如需轉載,請註明出處,否則將追究法律責任。

相關文章