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
1 changed files with 1 additions and 1 deletions

View File

@ -94,7 +94,7 @@ function RemoveSSH {
if [ -f "${HOME}/.ssh/id_rsa_local" ]; then
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}"
fi
}