Fixed removing temp key from authorized_keys didn't work
This commit is contained in:
parent
215e4f2108
commit
d320c84ce9
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue