Skip to content

Instantly share code, notes, and snippets.

@JDFagan
Last active December 1, 2016 19:37
Show Gist options
  • Save JDFagan/00f445316b0f144ef83b944ed02930eb to your computer and use it in GitHub Desktop.
Save JDFagan/00f445316b0f144ef83b944ed02930eb to your computer and use it in GitHub Desktop.

How to allow AWS across machine commands

To allow for diffing filesystems via rsync or running diff commands local vs remote. To make this work, easiest to allow root user to ssh into AWS instance.

How to enable security

For each machine you want to issue distributed compare like rsync or run diff remotely to any file:

sudo su
cd ~/.ssh
mv authorized_keys authorized_keys.orig
ssh-keygen -y -f somekey.pem > somekey.pub
cat somekey.pub >> authorized_keys

Using Rsync to compare filesystems across multiple machines

  • Ssh into machine jd2.butterfleye.co
rsync --dry-run -vacO --delete /home/someuser/ [email protected]:/home/someuser/
rsync --dry-run -vacO --delete [email protected]:/home/someuser/ /home/someuser/

Diffing local file vs remoted ssh'd file

diff /home/someuser/somedir/somefile.conf <(ssh [email protected] 'cat /home/someuser/somedir/somefile.conf')

References: http://blog-en.openalfa.com/how-to-compare-recursively-the-content-of-two-directories-with-rsync

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment