News for hackers. Stuff that matters.
Re:SSH Tricks by dsirijus on Tuesday July 01, 2014 @04:49PM (#7973419)
Sometimes, if we have a lot of SSH keys in our ~/.ssh directory

No, that's not how it's supposed to work. Ideally, one key per machine per user.

Re:SSH Tricks by fideloper on Tuesday July 01, 2014 @04:58PM (#7973467)
Hmmm interesting - do you recommend I use the same key for github, my personal server, some work servers, etc?
Re:SSH Tricks by cmsj on Tuesday July 01, 2014 @05:23PM (#7973599)
Yes, but use an RSA key.

It doesn't really matter how many you have, you still need to protect them. Encrypt your laptop, lock your screen when you get up for a break, etc, etc.

Re:SSH Tricks by robmccoll on Tuesday July 01, 2014 @10:46PM (#7974842)
Personally, I use one key pair per source user/device pair and then comment in the authorized keys where each public key is from. To me, it is more likely that a user/machine pair will be compromised than a key. This makes cutting a compromised box or account off easy. :-)
Re:SSH Tricks by emilsedgh on Tuesday July 01, 2014 @05:20PM (#7973585)
Why not?
Re:SSH Tricks by hamburglar on Tuesday July 01, 2014 @06:11PM (#7973802)
Personally, I like to have different keys that I treat with different levels of care/paranoia. I'm not particularly worried about leaving my github key 'added' to my ssh agent 24/7, but I don't do that with my work production key.
Re:SSH Tricks by manicdee on Tuesday July 01, 2014 @07:13PM (#7974066)
I prefer minimising the amount of work required to replace compromised keys. e.g.: I have a private SSH key on my work-supplied computer which I consider to be "compromised" for private purposes, but it's perfectly usable for work inside that company.

Use IdentityFile to specify which key to use with which remote host and you're golden.

edit: I also have that private SSH key on my personal computers so I can use SSH when working from home. Then when I stop working with that company I can simply remove that key, rather than generating a new SSH key and redistributing public keys to hosts that I use regularly.

edit edit: Using IdentityFile also helps automate the process of redistributing keys when you decide to generate a new one.

Re:SSH Tricks by X-Istence on Wednesday July 02, 2014 @12:00AM (#7975120)
When I stopped working for $company they had to remove my public key from all their authorized_keys files. There is no need for me to re-generate my private key...
Re:SSH Tricks by jsmeaton on Wednesday July 02, 2014 @01:01AM (#7975296)
Ouf, no thanks. I have a key per location. I have a single key for the machines I log in to at work. Another key for AWS. Another key for github. I also have separate keys for all of the above services for my semi-persistent local virtual machines.
Re:SSH Tricks by cmsj on Tuesday July 01, 2014 @04:55PM (#7973454)
Correct, but sometimes it's unavoidable, particularly when talking to dumb management devices :(
Re:SSH Tricks by akerl_ on Tuesday July 01, 2014 @05:23PM (#7973597)
id_ed25519, id_ecdsa, id_rsa, boom auth failure.
Re:SSH Tricks by cmsj on Tuesday July 01, 2014 @05:47PM (#7973699)
This is why we have IdentityFile :) (also afair you usually get more like 5 key attempts before failure)
Re:SSH Tricks by manicdee on Tuesday July 01, 2014 @07:18PM (#7974091)
Third and fourth tips in the article address that specific complaint.
Re:SSH Tricks by akerl_ on Tuesday July 01, 2014 @07:33PM (#7974150)
I know. I was clarifying for the comment I replied to that there are situations where the steps you're citing are relevant, because there are situations where you have multiple keys on the same user/system.