summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2022-04-22 15:47:06 +0200
committerErich Eckner <git@eckner.net>2022-04-22 15:47:06 +0200
commit389b40ee60b8fbd24dc81dc84f4d639dde3210be (patch)
tree4c6c83406cc799a133aa576eabfd73da2020b537
parentd002f55fe5d93a4e1bf0a3230222f2b2d66e787f (diff)
downloadssh-keystore-389b40ee60b8fbd24dc81dc84f4d639dde3210be.tar.xz
scripts/show-keys neu
-rwxr-xr-xscripts/show-keys20
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/show-keys b/scripts/show-keys
new file mode 100755
index 0000000..97e69f3
--- /dev/null
+++ b/scripts/show-keys
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+cd "${0%/*}/.."
+find hosts \
+ -type f \
+ -exec cat {} + \
+| tr -d '\r' \
+| sed '
+ s/^---- BEGIN SSH2 PUBLIC KEY ----$//
+ T
+ :a
+ N
+ s/\n---- END SSH2 PUBLIC KEY ----//
+ Ta
+ s/\n//g
+ s/^Comment: "\([^"]*\)"\(\S\+\)$/\2 \1/
+' \
+| sed '
+ s/^command="[^"]*"\(,\S\+\)\? //
+'