From: Mark Wooding Date: Sat, 4 Apr 2015 11:50:17 +0000 (+0100) Subject: Build .ssh/authorized_keys using our sshsvc machinery. X-Git-Url: https://git.distorted.org.uk/~mdw/dyndns/commitdiff_plain/66443416b6cdda37a0945c89b736b3bb3c772a8b Build .ssh/authorized_keys using our sshsvc machinery. --- diff --git a/.gitignore b/.gitignore index aa88922..bd8ebae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -.ssh/ dyndns.conf diff --git a/.ssh/.gitignore b/.ssh/.gitignore new file mode 100644 index 0000000..80702e3 --- /dev/null +++ b/.ssh/.gitignore @@ -0,0 +1,3 @@ +authorized_keys +domains.conf +keys/ diff --git a/.ssh/Makefile b/.ssh/Makefile new file mode 100644 index 0000000..a5d51e0 --- /dev/null +++ b/.ssh/Makefile @@ -0,0 +1,4 @@ +### -*-makefile-*- + +authorized_keys: sshsvc.conf domains.conf keys $(wildcard keys/*.pub) + sshsvc-mkauthkeys diff --git a/.ssh/sshsvc.conf b/.ssh/sshsvc.conf new file mode 100644 index 0000000..5099cdd --- /dev/null +++ b/.ssh/sshsvc.conf @@ -0,0 +1,22 @@ +### -*-sh-*- + +make_key_line () { + user=$1 + hosts="" + zone="" + while read u hh; do + case $u in "" | \#*) continue ;; esac + case $user in $u) ;; *) continue ;; esac + for h in $hh; do + case $h in + zone=*) zone=${h#*=} ;; + *) hosts=${hosts:+$hosts }$h ;; + esac + done + done &2 "$0: incorrect address (wanted = $2; found = $addr)" + echo >&2 "$0: incorrect address (wanted = $client; found = $1)" exit 3 ;; esac