AWS SSH RSYNC
Jump to navigation
Jump to search
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/<cert_name.pem>
- Change permissions on the .pem file to 400 -> chmod 400 cert_name.pem
- 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/