Scp/ssh/rsync operation method without entering the password

Source: Internet
Author: User

When you use Scp/ssh/rsync to transfer files, you will need to enter a password. The following is a method for password-free transfer of files.

Suppose you want to transfer files between two hosts, Host_src & Host_dst. HOST_SRC is the machine where the file source address resides, and HOST_DST is the machine where the destination address resides.

1. On the HOST_SRC machine, log in with the user executing the Scp/ssh/rsync command and execute the following command:

$ ssh-keygen-t RSA

Press ENTER to continue, the default public key will be stored in the

~/.ssh/id_rsa.pub:

Your public key have been saved in <your_home_dir>/.ssh/id_rsa.pub

2. Transfer the id_rsa.pub file to the Host_dest machine via FTP, SCP, rsync, etc.

3. Log in host_dst with the appropriate account

4. Append the contents of the id_rsa.pub to the ~/.ssh/authorized_keys

$ cat Id_rsa.pub >>~/.ssh/authorized_keys
$ chmod ~/.ssh/authorized_keys

5. Note that SSH does not allow root login by default, you need to modify the Permitrootlogin option of the/etc/ssh/sshd_config file and change no to Yes.

Reference: Https://blogs.oracle.com/jkini/entry/how_to_scp_scp_and

Scp/ssh/rsync operation method without entering the password

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.