authorized_keys tail

crash2
Geoffrey Frogeye 2019-06-03 21:03:41 +02:00
parent 26d74cb5e2
commit 0ee03a1173
2 changed files with 5 additions and 3 deletions

View File

@ -128,9 +128,6 @@ function _machines-getAkey { # network
SIGN_FILE=$(mktemp)
_machines-api "akey/$1" > "$KEY_FILE"
_machines-api "akey/$1?signature" > "$SIGN_FILE"
md5sum "$KEY_FILE" 1>&2;
md5sum "$SIGN_FILE" 1>&2;
md5sum "$MACHINES_CONFIG/machines.pub" 1>&2;
if openssl dgst -sha256 -verify "$MACHINES_CONFIG/machines.pub" -signature "$SIGN_FILE" "$KEY_FILE" &> /dev/null
then
@ -149,6 +146,10 @@ function _machines-updateAkey {
if _machines-getAkey "$network" > "$MYKEY_FILE"
then
\mv -f "$MYKEY_FILE" "$MACHINES_HOME/.ssh/authorized_keys"
if [ -f "$MACHINES_HOME/.ssh/authorized_keys.tail" ]
then
cat "$MACHINES_HOME/.ssh/authorized_keys.tail" >> "$MACHINES_HOME/.ssh/authorized_keys"
fi
return 0
else
cat "$MYKEY_FILE"

View File

@ -18,6 +18,7 @@ alias grep="grep --color=tty"
alias dd='dd status=progress'
alias rm='rm -v --one-file-system'
alias free='free -m'
alias diff='diff --color=auto'
alias dmesg='dmesg --ctime'
alias wget='wget --hsts-file $HOME/.cache/wget-hsts'