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.