cleverca22
8/1/2015 - 10:18 PM

Use github to get authorized keys and start ssh

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