- 论坛徽章:
- 0
|
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 linux1, login as user1. do
ssh-keygen -P "" -trsa1 -f ~/.ssh/identity
4. Copy key file to linux2
scp /home/user1/.ssh/identity.pub user2@linux2:/home/user2/.ssh/authorized_keys
5. Change file permission
chmod 600 /home/user1/.ssh/identity.pub
6. change ssh config file: /etc/ssh/ssh_config
Ad
Host *
ForwardX11 yes
IdentityFile ~/.ssh/identity
Protocol 1
7. Restart sshd
8. login to linux2 as user2.
9.Change file permission
chmod 600 /home/user2/.ssh/authorized_keys
10. Restart sshd
Now, you can ssh or secure copy filles by using user1 from linux1 to linux2 without prompt |
|