2
0
mirror of https://github.com/deajan/osync synced 2024-11-17 09:25:42 +00:00

Fixed removing temp key from authorized_keys didn't work

This commit is contained in:
deajan 2017-02-08 14:19:20 +01:00
parent 215e4f2108
commit d320c84ce9

View File

@ -94,7 +94,7 @@ function RemoveSSH {
if [ -f "${HOME}/.ssh/id_rsa_local" ]; then if [ -f "${HOME}/.ssh/id_rsa_local" ]; then
pubkey=$(cat "${HOME}/.ssh/id_rsa_local.pub") pubkey=$(cat "${HOME}/.ssh/id_rsa_local.pub")
sed -i.bak "#$pubkey#d" "${HOME}/.ssh/authorized_keys" sed -i.bak "s|.*$pubkey.*||g" "${HOME}/.ssh/authorized_keys"
rm -f "${HOME}/.ssh/{id_rsa_local.pub,id_rsa_local}" rm -f "${HOME}/.ssh/{id_rsa_local.pub,id_rsa_local}"
fi fi
} }