AWS SSH RSYNC: Difference between revisions

From SWKLS WIKI
Jump to navigation Jump to search
(Created page with "==AWS SSH and RSYNC Setup== ===SSH From CentOS to AWS Linux=== # Convert AWS EC2 user .ppk to a .pem with PuttyGen # Load the .pem file onto the CentOS linux server -> /root/...")
 
No edit summary
 
Line 21: Line 21:
rsync -avhz --stats --progress -e "ssh -i /path/to/file/name.pem" /var/www/html/ ec2-user@x.x.x.x:/var/www/html/
rsync -avhz --stats --progress -e "ssh -i /path/to/file/name.pem" /var/www/html/ ec2-user@x.x.x.x:/var/www/html/
</syntaxhighlight>
</syntaxhighlight>
[[Category:AWS]]

Latest revision as of 21:45, 13 November 2020

AWS SSH and RSYNC Setup

SSH From CentOS to AWS Linux

  1. Convert AWS EC2 user .ppk to a .pem with PuttyGen
  2. Load the .pem file onto the CentOS linux server -> /root/<cert_name.pem>
  3. Change permissions on the .pem file to 400 -> chmod 400 cert_name.pem
  4. Login using (change x.x.x.x to IP) -> ssh -i /root/cert_name.pem ec2-user@x.x.x.x


Rsync over SSH from CentOS to AWS Linux

rsync <options> <_source> <_destination>

  • -v : verbose
  • -r : copies data recursively (but don’t preserve timestamps and permission while transferring data
  • -a : archive mode, archive mode allows copying files recursively and it also preserves symbolic links, file permissions, user & group ownerships and timestamps
  • -z : compress file data
  • -h : human-readable, output numbers in a human-readable format


Example

rsync -avhz --stats --progress -e "ssh -i /path/to/file/name.pem" /var/www/html/ ec2-user@x.x.x.x:/var/www/html/