ON REMOTE BOX:
dnf —assumeyes install rsync ;
sudo cat /etc/ssh/sshd_config | grep PasswordAuthentication ; ## look for ‘yes’
ON LOCAL BOX:
su comptonpeslonline.com ;
cat /home/comptonpeslonline.com/.ssh/known_hosts ; ## delete any previous keys so the first login will prompt for it.
ssh comptonpeslonline.com@35.192.35.140 ; ## verify login works, prompts for password
ssh-keygen ; ## creates /home/comptonpeslonline.com/.ssh/id_rsa.pub !
ssh-copy-id -i /home/comptonpeslonline.com/.ssh/id_rsa.pub comptonpeslonline.com@104.218.50.87 ; ## prompts for password
##ssh-copy on LOCAL: does nothing (??)
##ssh-copy on REMOTE: adds line to /home/comptonpeslonline.com/.ssh/authorized_keys
ssh comptonpeslonline.com@35.192.35.140 ; ## verify login works, stops prompting for password
## 2020-09-01 (is —owner really required??) sshpass -p “XXXXXXXXXXXXx” \ runuser —user comptonpeslonline.com — /usr/bin/rsync \ —dry-run —verbose —archive \ —owner=comptonpeslonline.com \ /home/comptonpeslonline.com/ \ comptonpeslonline.com@edwardsmarkf.info:/home/comptonpeslonline.com/ \ ;rsync —verbose —archive /home/comptonpeslonline.com/public_html/ \ comptonpeslonline.com@104.218.50.87:/home/comptonpeslonline.com/public_html/
sshpass and rsync ======= — 2020-01-22
sync data between different servers (or possibly the same one)
sshpass -p “zXXXX” \ rsync —verbose —archive \ mark@comptonpeslonline.info:/home/mark/rsyncTest \ /home/mark/ ; ## NEW to OLD!
sshpass -p “XXX” \ rsync —verbose —archive \ /home/mark/rsyncTest \ mark@comptonpeslonline.info:/home/mark/ ; # OLD to NEW!
## remote usage, notice StrictHostKeyChecking was required in some instances.
sshpass -p ‘XXX’ \
rsync —dry-run —verbose —archive \
—rsh=“ssh -o StrictHostKeyChecking=no” \
/home/comptonpeslonline.com \
comptonpeslonline.com@edwardsmarkf.info:/home/comptonpeslonline.com ;
## this machine to a “remote” machine! (notice ‘dry-run’ — remove it!)
## https://www.digitalocean.com/community/tutorials/how-to-use-rsync-to-sync-local-and-remote-directories-on-a-vps
cd ~ ; ssh-keygen -t rsa ; ### create a new keyset at the root directory
ssh-copy-id —dry-run comptonpeslonline.com@edwardsmarkf.info ;
### copy key to appropriate place
==========================================