Last active
March 23, 2016 01:18
-
-
Save zimbatm/3166cc0bbb46551fe67e to your computer and use it in GitHub Desktop.
Use github to get authorized keys and start ssh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Fetches SSH keys from a github user and starts openssh | |
# | |
if [ -z "$user" ]; then | |
user=zimbatm | |
fi | |
mkdir -m 0700 -p "$HOME/.ssh" | |
curl "https://github.com/$user.keys" > "$HOME/.ssh/authorized_keys" | |
systemctl start sshd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
curl -L http://git.io/vOGOo | user=your_github_user sh