Linux notes executes the SCP in the background, enabling no password file copies between servers.

Source: Internet
Author: User

Remote backup large capacity often there is the case that the file from remote backup is very large, it takes a long time, you want to exit SSH after the program can still continue to download in the background, can be established through the establishment of inter-server security information relationship and nohup way to solve.

There are two servers: a server IP 192.168.3.100, b server IP 121.41.111.46.

I. Establish a secure trust relationship certificate between servers

1. Generate key pairing on Server A

The a server generates a pairing key, and when prompted, leave the default to hit Enter,

[[Email protected] ~] #ssh-keygen-t RSA

The public key is saved in the. SSH directory of the user host directory, such as the root user will be placed in the/root/.ssh/id_rsa.pub.

2. Copy public key to B server

Copy the Id_rsa.pub file that you just generated from a server to the ~/.ssh/directory of the B server and rename the file to Authorized_keys.

[[Email protected] ~] #scp ~/.ssh/id_rsa.pub 121.41.111.46:/root/.ssh/authorized_keys

3, A, b server between the non-secret copy

After the above operation, you can implement a server does not require a password to obtain the file B server, SCP, sssh command.

[[Email protected] ~] #scp [email protected]:/data./

Second, nohup implementation to close the SSH window after the program can continue to run in the background

Nohup scp.sh &

Linux notes executes the SCP in the background, enabling no password file copies between servers.

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.