Transfers files between two hosts without a password

Source: Internet
Author: User
Implement file transfer between two machines without a password-Linux Enterprise Application-Linux server application information. The following is a detailed description. Assume there are two linux machines, linux1 and linux2. If you want to copy a machine from linux1 to linux2, you do not need to enter a password, or do this in the ctontab.

1. Install SSH
2. Create two users, user1 on linux1 and user2 on 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.