Skip to content

Instantly share code, notes, and snippets.

@trydofor
Created September 15, 2017 01:25
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 trydofor/ad4328a8ff6ac0e9c4fa1f03c7383b80 to your computer and use it in GitHub Desktop.
Save trydofor/ad4328a8ff6ac0e9c4fa1f03c7383b80 to your computer and use it in GitHub Desktop.
ssh auto login
#!/bin/bash
cat << EOF
#On Client:
[ -d ~/.ssh ] || mkdir .ssh
[ -f ~/.ssh/id_rsa.pub ] || ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub
# On Server
[ -d ~/.ssh ] || mkdir .ssh
cat >>~/.ssh/authorized_keys <<END
the id_rsa.pub on client
END
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment