46
13
This isn't so much a technical question as it is conceptual. I understand the cryptography used in an SSH key is far stronger than a regular password, but I don't understand why it is considered more secure.
Most tutorials I read suggest using SSH key authentication rather than password authentication. But my understanding is that anyone who then has access to a pre-approved client machine will then be able to connect to the server, meaning that the level of security provided by the SSH key is only as strong as the level of security of the physical client machine.
For example, if I setup an SSH key on my phone to connect to my home machine, should I lose my phone and someone manages to unlock it, they will be able to connect to my home machine. I know I can then remove the key for my phone from my home machine, but I'm vulnerable until I realise the client device has been lost/breached.
Have I misunderstood something, or are those valid concerns?
10Do both - a key that requires a password. That way you need two things to be identified, not just one. You can also invalidate lost keys quite easily, and have multiple authorised keys for more control over that, so on. – Phoshi – 2011-06-28T13:00:50.130
2This should probably be moved to security. – None – 2011-06-28T16:58:44.493
10@DKGasser: No, it shouldn't. It's a perfectly valid question here. Just because something can be moved to another SE site doesn't mean it should. – Wuffers – 2011-06-28T17:04:28.983
@Mark If it has a place that was designed precisely for it, I think it should? – None – 2011-06-28T17:20:05.963
4@DKGasser: It could go to that site, it is a perfectly valid question there. But it is also a valid question here, so there is no reason to migrate it. If this question were to be made off topic here, then yes, it could be migrated there. But it is totally on topic on this site and therefore shouldn't be migrated. – Wuffers – 2011-06-28T17:29:11.383
@Mark - according to the FAQ it is offtopic here - but on topic at security.stackexchange. SU is for questions about computer hardware and computer software, but this questions is not actually about either, it is about why a particular method is better than another (and I don't mean method in the programming sense) – Rory Alsop – 2011-06-29T12:01:45.650
@Rory: This is a question about SSH, which is computer software. So it's on-topic. – Wuffers – 2011-06-29T15:36:54.033
But the question is around what is better - key auth or password - which is a pure security question, that pretty much has nothing to do with SSH or whichever toolkit you wish to use. It doesn't really matter whether it stays, but I know which site I would go to for security specific guidance though:-) – Rory Alsop – 2011-06-29T18:53:27.467
3AND don't forget, the SSH key never goes over the network. The remote server NEVER gets the key, as opposed to a password, that is not only sent over the network, but sent to the remote server. Think about that next time you're not sure what password to use, and try a few... that maybe used on other accounts! What passwords did you send to that server??? – 9mjb – 2014-06-18T17:42:11.700