Skip to content

Instantly share code, notes, and snippets.

@zimbatm
Last active March 23, 2016 01:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zimbatm/3166cc0bbb46551fe67e to your computer and use it in GitHub Desktop.
Save zimbatm/3166cc0bbb46551fe67e to your computer and use it in GitHub Desktop.
Use github to get authorized keys and start ssh
#!/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
@zimbatm
Copy link
Author

zimbatm commented Aug 1, 2015

Usage:

curl -L http://git.io/vOGOo | user=your_github_user sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment