Skip to content

Instantly share code, notes, and snippets.

@mindthump
Created June 12, 2020 18:09
Show Gist options
  • Save mindthump/887ba7e10712785488050a3377824976 to your computer and use it in GitHub Desktop.
Save mindthump/887ba7e10712785488050a3377824976 to your computer and use it in GitHub Desktop.
# Passwordless SSH -> 192.168.0.11 as sheena
# From "https://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/"
# Login to local box...
# Generate RSA key
ssh-keygen -t rsa
# Create .ssh directory
ssh sheena@192.168.0.11 mkdir -p .ssh
# Copy id_rsa.pub to authorized_keys
cat .ssh/id_rsa.pub | ssh sheena@192.168.0.11 'cat >> .ssh/authorized_keys'
# Set permissions
ssh sheena@192.168.0.11 "chmod 700 .ssh; chmod 640 .ssh/authorized_keys"
# Login without password
ssh sheena@192.168.0.11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment