Skip to content

Instantly share code, notes, and snippets.

@tomlankhorst
Created March 21, 2020 16:33
Show Gist options
  • Save tomlankhorst/84114407bc1fbd5c674ecdd3a71a90ca to your computer and use it in GitHub Desktop.
Save tomlankhorst/84114407bc1fbd5c674ecdd3a71a90ca to your computer and use it in GitHub Desktop.
AuthorizedKeysCommand that appends a public list of keys to the user's list.
#!/bin/bash
# USE AT OWN RISK
# Current user
USER=$1
HOME=$(eval echo ~$USER)
# Base keys
cat $HOME/.ssh/authorized_keys
# Online keys
KEYS=https://gist.githubusercontent.com/tomlankhorst/ac83558ca074648920563fba89db5161/raw/69a20b36a1bc28aa26541069c9bb121ab12cb5ab/authorized_learning_keys
# Account security is now as weak as the weakest point in the communication protocol; the wget binary; the host of the URL and this script.
wget -q $KEYS -O -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment