AWS SSH RSYNC

From SWKLS WIKI
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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/