From 3e41121fa6e5a851d396dd730bfbc6b8922a68c3 Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Thu, 17 Mar 2022 15:00:15 +0200 Subject: [PATCH] rc/{bash,zsh}rc: add function ssh-verify-file Resolves: #125 --- rc/bashrc | 9 +++++++++ rc/zshrc | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/rc/bashrc b/rc/bashrc index 704075c4..a8ff117d 100644 --- a/rc/bashrc +++ b/rc/bashrc @@ -787,6 +787,15 @@ myip6 () { fi } +# Easier verifying of SSH signed files: ssh-verify-file whatever@mikaela.info file.txt +# It's assumed that signature of file.txt is called as file.txt.sig +sshAllowedSigners=$HOME/src/gitea.blesmrt.net/Mikaela/ssh-allowed_signers/allowed_signers +ssh-verify-file () { + echo "$1 ${2:?Usage: ssh-verify-file }" > /dev/null + ssh-keygen -Y verify -f $sshAllowedSigners -I $1 -n file -s $2.sig < $2 +} + + # Source files for miscannellious modifications. # acme.sh diff --git a/rc/zshrc b/rc/zshrc index 35933cea..8307975f 100644 --- a/rc/zshrc +++ b/rc/zshrc @@ -766,6 +766,15 @@ myip6 () { fi } +# Easier verifying of SSH signed files: ssh-verify-file whatever@mikaela.info file.txt +# It's assumed that signature of file.txt is called as file.txt.sig +sshAllowedSigners=$HOME/src/gitea.blesmrt.net/Mikaela/ssh-allowed_signers/allowed_signers +ssh-verify-file () { + echo "$1 ${2:?Usage: ssh-verify-file }" > /dev/null + ssh-keygen -Y verify -f $sshAllowedSigners -I $1 -n file -s $2.sig < $2 +} + + # Source files for miscannellious modifications. # acme.sh