Assumption: Server A is the source server, Server B is the target server, and the data of Server A needs to be synchronized to Server B. 1. Use SSH to log in to server A and create public SSH keys without password. ssh-keygen -f ~/.ssh/id_rsa -q -P "" Get the public SSH key, like the following code: ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAyISE0v+WzNz4kNcyoVGdcuVKamoq8GbEE/jFefWu47urdYEGuowb6Dt+nJl9ZoaSGNknkoUrzICKbxA0NFsJZL4GrRRAsI54UKo5ggUWek17ald1KmohfezF5BJ8DiPPcq5sZmtg18L6uhMk7sQuwMpUTpuy7YQtuGi2xz9Xh+E/mt7+JNGmI6NsqifTd7SIUNCR5lHd/VVTdNxTAArO8vffuNn5GCenBlfilugKGlehcdV7dJTYXwPtuSdTTocwDBYHTPVtTVBmtpG0882QMr7J2iOpIA2jTNl7jY5mUfV+SYOlcRMSlxhs2W/rtfcytSdv4m8hjwSTQANF1xtSxQ== [email protected] 2. Use SSH to log in to server B Create the authorized_keys file to store the public SSH key of server A. If there is no authorized_keys file, create this file. mkdir ~/.ssh Edit the authorized_keys file: vi ~/.ssh/authorized_keys, press i, paste the public SH key of server A, then press esc, :wq to save and exit. 3. Actual combat, synchronize files Synchronize server A (167.88.112.127) /home/wwwroot/tools.zhujiwiki.com/html/bus.zip to the same directory of server B (23.227.177.230). rsync -avz -e “ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null” –progress /home/wwwroot/tools.zhujiwiki.com/html/bus.zip 23.227.177.230:/home/wwwroot/ via: digitalocean |
<<: Install phpMyBackupPro on CentOS VPS to backup MySQL database
>>: The process of transferring a domain from Godaddy to NameSilo
BlueVM is an American hosting company that has be...
Some time ago, we introduced OVH's Advance se...
HostTheBest is a long-established American hostin...
URPad.net was established in September 2010 and p...
anyhk, a newly established merchant in December 2...
CloudCone is a relatively active hosting provider...
For Debian 7.x or 8.x. Looking at the functions, ...
nat.bz, a Chinese merchant, provides Shanghai Uni...
According to its homepage, OneNetwork was founded...
Swarmify is a foreign merchant that specializes i...
VMBox is an American hosting company established ...
Data Ideas is a foreign merchant that mainly prov...
EUserv, a German hosting company, has been establ...
CloudCone is a relatively active hosting provider...
Limited time special offer, hurry up and get on b...