Skip to content

Instantly share code, notes, and snippets.

@mayvazyan
Last active December 6, 2020 19:06
Show Gist options
  • Save mayvazyan/f2df55f922dc909e1217e22cc14aec77 to your computer and use it in GitHub Desktop.
Save mayvazyan/f2df55f922dc909e1217e22cc14aec77 to your computer and use it in GitHub Desktop.
./enable_ssh.sh example.com
# Allows to quickly enable access using rsa public key
# Example usage:
# ./enable_ssh example.com
cat ~/.ssh/id_rsa.pub | ssh $1 "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment