3

This morning when connecting to my Ubuntu VPS, my local computer is suddenly complaining about my private key:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/home/noah/.ssh/id_rsa' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /home/noah/.ssh/id_rsa

I guess it is possible that I accidentally set the permissions recursively some how, but I think it unlikely... I'm wondering if this might be a result of malware of some sort? I've changed the permissions back to 600, and the warning goes away.

2
  • 1
    This happens to me every time i run a repair permissions on a Mac
    – Silverfire
    Jul 15, 2011 at 1:40
  • I got the same today on my Arch Linux laptop, I made some updates with the package manager yesterday and installed some screenshot plugins on Firefox today. I have now removed them. I created a new key pair with passphrase and updated the public key on all my recent server accounts. Hope that will be enough, I know ssh did not complain yesterday so permissions must have been ok yesterday. :/
    – tirithen
    Apr 21, 2015 at 11:00

1 Answer 1

5

Try looking through your ~/.bash_history (or your shell of choice's history file) to see if you accidentally did chmod-ed your private key. That seems the most likely explanation.

If you share this system with other users and your ~/.ssh/ directory is group or world readable you should generate a new private key (see ssh-keygen).

Yes, it could of been caused by malware or someone could of hacked your system... but as my high school auto shop teacher always said, "Fix the easy stuff first,". Do some investigation and see if just wasn't an accident (I've accidentally chmod-ed many things myself) before you start looking into a security compromise.

4
  • Thanks, history shows nothing, though. I don't share the machine with others, either, but I guess I should generate a new private key - a bit of a chore, since I'm using the key to connect to several servers. Jul 18, 2011 at 2:30
  • Try checking root's .bash_history as well. Additionally, you may want to adjust your $HISTSIZE in ~/.bashrc to increase the length of time commands remain in your shell's history file.
    – user62491
    Jul 18, 2011 at 22:44
  • thanks, @kce, but nothing in root's history either. And my $HISTFILESIZE is set to 2000. Jul 21, 2011 at 10:17
  • Bizarre. You probably should keep a close eye on this system, because if you didn't change the permissions than something else had too. And that doesn't bode well.
    – user62491
    Jul 21, 2011 at 15:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .