author | NIIBE Yutaka <gniibe@fsij.org> | 2014年05月30日 14:57:57 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2014年05月30日 14:57:57 +0900 |
commit | 61a1d4ca6c7b88123e94477ac26209e0075fd143 (patch) | |
tree | aa6f4e6060dfda9555b399e9f753e606ee1ea422 /convert-authkey-ssh.sh |
-rwxr-xr-x | convert-authkey-ssh.sh | 12 |
diff --git a/convert-authkey-ssh.sh b/convert-authkey-ssh.sh new file mode 100755 index 0000000..909a98f --- /dev/null +++ b/convert-authkey-ssh.sh @@ -0,0 +1,12 @@ +#! /bin/sh + +exec >authorized_keys + +# Show public keys in the keyring, extract public key with A, +# and show its user name and subkey ID. +gpg --no-default-keyring --keyring ./1ドル \ + --list-public-key --with-colons \ +| sed -n -e '/A:$/s/^.*:\([^:]*\)::[a-zA-Z]*:$/1円/p' \ + -e '/a:$/s/^.*\(........\):[-0-9]*::::::a:$/1円/p' \ +| while read USER_ID; do read SUBKEY_ID; echo $USER_ID>/dev/tty; \ + gpgkey2ssh $SUBKEY_ID | sed -e "s/COMMENT/$USER_ID/"; done |