Live data from Hacker News

SSH: Best practices

blog.0xbadc0de.be

121–123 of 123 posts

Re: SSH: Best practices

#121
post #18

Earlier quoted context omitted.

Security is not binary. In this case it depends on whether disclosing your identity to the servers you connect to is a problem in your threat model. Saying "they are public so it's ok" is technical oversimplification.

It's not binary, but if your security depends on your public key being secret, something else must be wrong. It's the same as someone who depends on their IP addresses being secret. That's not something you can count on, and your security would be better served by designing your infrastructure with the assumption that it's totally public information.

> public key

The word public is just a name for a kind of key defined in the field of cryptography and doesn't necessary hold the same connotation in application protocols that use public key cryptography. One example would be ephemeral public key that would have to be kept private to be able to retain forward secrecy (although in such schemes DH is usually used).

Consider as well this situation that is closer to SSH. Suppose that you are MS dev working on NT kernel that by night also want to anonymously contribute to Linux. Obviously both camps would not like you to do that for fear of copyright infringement but OpenSSH shouldn't betray you anonymity that could be reasonably expected. It's imaginable that only one public crypto key pair would be needed to authenticate the server if password authentication is used for the client. The user doesn't expect the client software to silently generate key pair, much less that the same pair is used for every domain because the pair is not strictly needed. Although the user should inform himself how the software works a good software similarly shouldn't work in ways that are reasonably unexpected to people that are familiar with the domain. Ideally, if OpenSSH developers can't really foresee it working any other way OpenSSH should at least explicitly inform the user which public key will be used in connection before it is established in order to not assume the consent of poorly informed users.

Re: SSH: Best practices

#122
post #93

Earlier quoted context omitted.

There's nothing in PCI which prevents the use of SSH keys. In no scenario is password auth more secure than key auth.

There is a step where the auditor will observe you entering a correct and an incorrect password to enter the systems. If your org is depending on SSH key passphrases for this step and you get the wrong person in front of the auditor (the one without the passphrase on their key) then you just failed the audit. The more steps you fail, the deeper down the rabbit holes they go with each step. If they see you are not fai…

What happens if an ssh agent is used? pageant requests the passphrase and then leaves it unlocked. Or is this audit step set up so I can remove the key from my agent and then demonstrate that I need a proper password to get in?

Re: SSH: Best practices

#123
post #108
post #30

Weird, where I work we're not allowed to use key auth. They claim it's for PCI since they can't enforce that the keys are passworded/encrypted.

You could require both pubkey + password: https://sysconfig.org.uk/two-factor-authentication-with-ssh....

I believe this was attempted, but they were running an older version of openSSH that was only getting security patches. OTP was not being triggered if an SSH key was used. so it was either password + OTP or ssh-key alone. They opted to disable ssh-key auth as the solution
Post reply on HN