Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
AuthorizedKeysCommandで公開鍵リストをwebからダウンロードしてくる
#!/bin/sh
url='URL here'
home=`cat /etc/passwd |egrep ^${1}: |cut -d: -f6`
ssh_local_path="${home}/.ssh"
if [ ! -e $ssh_local_path ]; then
mkdir $ssh_local_path
fi
/usr/local/bin/curl -L $url | sed '/^$/d' | tee ${ssh_local_path}/authorized_keys.new
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment