Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Owner

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