Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
This happens to me every time i run a repair permissions on a Mac –  Silverfire Jul 15 '11 at 1:40

1 Answer 1

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.

share|improve this answer
    
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. –  yuttadhammo Jul 18 '11 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. –  kce Jul 18 '11 at 22:44
    
thanks, @kce, but nothing in root's history either. And my $HISTFILESIZE is set to 2000. –  yuttadhammo Jul 21 '11 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. –  kce Jul 21 '11 at 15:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.