ssh-key-server

Generate keys using.

ssh-keygen -t rsa

Create file /usr/local/bin/userkeys.sh and chmod a+x

#!/bin/bash
# The user is stored in $1
curl -sf https://github.com/$1.keys
  • Or use ssh to your own key server
#!/bin/bash
ssh my-secret-server "cat /home/$1/.ssh/*.pub"

Configure sshd

  • add those lines to /etc/ssh/sshd_config
ChallengeResponseAuthentication no
UsePAM no
PasswordAuthentication no
AuthorizedKeysCommand      /usr/local/bin/userkeys.sh
AuthorizedKeysCommandUser  nobody
Subsystem       sftp    /usr/lib/openssh/sftp-server

Voila, you are using github as a keyserver.