Skip to content

Instantly share code, notes, and snippets.

@rafaelrozon
Last active December 31, 2015 08:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaelrozon/ccc9e526103382bf5c1a to your computer and use it in GitHub Desktop.
Save rafaelrozon/ccc9e526103382bf5c1a to your computer and use it in GitHub Desktop.
ssh without password
ssh-keygen -t rsa
ssh user@host mkdir -p .ssh
cat .ssh/id_rsa.pub | ssh user@host 'cat >> .ssh/authorized_keys'
ssh user@host 'chmod 700 .ssh; chmod 640 .ssh/authorized_keys'
ssh user@host
the user to authenticated needs to be owner of the authorized_keys file. Change it with
sudo chown user authorized_keys
boom, done!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment