AWS SSH RSYNC

From SWKLS WIKI
Revision as of 21:45, 13 November 2020 by Unknown user (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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/