linux的两个机器间传送文件

王朝system·作者佚名  2008-05-18
窄屏简体版  字體: |||超大  

How to transfer files between two linux boxs without pwd

Let me guess you have two linux boxs ( linux1 and linux2). You want to copy files from linux1 to linux2 without password or do it at crontab.

1. Install SSH

2. Create two users. user1 at liunx1 and user2 at 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 prompt

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航