Search code examples
sshsshd

Delete SSH key without SSH access


My sshd is refusing to restart because of the following error:

@ WARNING: UNPROTECTED PRIVATE KEY FILE! @

However, i cant figure out how to delete the unsafe ssh keys without having the ssh access. What to do?


Solution

  • You need to chmod 600 ~/.ssh/rsa_key. This protects the keyfile from other users on the same system beeing able to read/steal it.