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
1HOST.EU, a Dutch hosting provider, claims to hav...
Details: Tospeed: 24 yuan/month/512MB memory/150G...
AlphaRacks has launched SSD kvm vps, which has mu...
AKsmart, a Chinese hosting provider, focuses on S...
Welcome to share, merchants are welcome to join, ...
Also released for Christmas, it allows registrati...
RootNerds, a German hosting company founded in 20...
Host Media, a formal company, Company Registratio...
OVH, a long-established hosting provider, has its...
Advin Servers, a foreign merchant, seems to be ne...
DeinServerHost, a German hosting provider, was es...
Webtropia, owned by myLoc, now has an updated ind...
Hostbig was founded in 2004 and is an American ho...
As we all know, edu mailbox belongs to the educat...
Aoyouhost is a long-established Chinese business ...