Skip to content

Instantly share code, notes, and snippets.

@meleyal
Created April 17, 2009 10:19
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 meleyal/96956 to your computer and use it in GitHub Desktop.
Save meleyal/96956 to your computer and use it in GitHub Desktop.
SSH passwordless logins
# Create the .ssh directory if it's not already under ~/
ssh user@server
mkdir .ssh
chmod 700 .ssh
exit
# Create a private/public key pair if you didn't already
ssh-keygen
# Copy your public key to the remote server
cat .ssh/id_rsa.pub | ssh user@server "cat >> .ssh/authorized_keys"
# You should now be able to login without a password prompt
ssh user@server
# If not, check the permissions again of ~/.ssh and ~/.ssh/authorized_keys
# Both should be set to 700 (rwx only by user)
# If it's still not working, check the permissions of your home directory (/home/user)
# It should be set to 755 (drwxr-xr-x)
# If for some reason you see a capital S in the permissions, chmod g-s should remove it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment