Live data from Hacker News

Show HN: My SSH server knows who you are

blog.filippo.io

181–190 of 257 posts

Re: Show HN: My SSH server knows who you are

#181
post #99

I use different keypairs for different trust domains. (also makes it easier to hand over access when you quit a job.) SSH keys are actually pretty horrible from a security perspective; no expiration, generally held in software, etc. And without a lot of work, single-factor. I love the ssh security model of being pretty good and better than telnet for everything (which it ~fully displaced, unlike https vs. http), but…

> And without a lot of work, single-factor.

Wouldn't a passphrase be a second factor?

By the way, we use a security fob at work for that. Seems to work fairly well. The private key never leaves the fob, you have to press a button to sign anything, and every once in a while you have to enter your passphrase.

Re: Show HN: My SSH server knows who you are

#182

Earlier quoted context omitted.

It's a public key for a reason. You need to the private key to authenticate, so you're safe having everyone know your public key.

> It's a public key for a reason It's public key because it's named such in the context of public key cryptography. But not all public keys should be available to public. Ideally by default ssh client should use a different key pair for each server('s public key) it connects to. Some people want to hide their identity, for example Tox people chose to be anonymous, what SSH does goes against expectations so it has the…

Not only a different key-pair per server, but also per session.

Re: Show HN: My SSH server knows who you are

#183

Luckily, putty/kitty does not send anything to unknown hosts. Good try though. Please accept a record of my IP address connecting to your honeypot as a token of gratitude.

The standard linux ssh client also asks for confirmation before sending anything interesting to a new server.

Re: Show HN: My SSH server knows who you are

#184
post #38
post #21

In all seriousity, I would love a similar SSH server that automatically uses keys from GitHub for authentication. Great for setting up a little private git server without fiddling with keys.

Just keep in mind that you're now at the mercy of github. Or whomever pwns their servers.

You can salvage something from that idea: github is in the public eye. If they do something fishy, you'll probably now about it a month later.

So, for your login service you scrap github periodically, and only trust things that have been there a month ago already.

(A bit like ssh being vulnerable to MitM attack on the very first connection, but not afterwards.)

Re: Show HN: My SSH server knows who you are

#185

Didn't work for me. Here's what I got. I cleaned out .ssh/knownhosts after connecting. +---------------------------------------------------------------------+ | | | _o/ Hello! | | | | | | Did you know that ssh sends all your public keys to any server | | it tries to authenticate to? You can see yours echoed below. | | | | We tried to use that to find your GitHub username, but we | | couldn't :( maybe you don't even h…

Hi! A few reasons it might fail: * You don't have your SSH keys on GitHub * You don't have your GitHub keys on that laptop * Your key is not RSA (because I'm LAZY) * Your ssh version uses only recent algorithms not supported by Go's x/crypto/ssh * You actually disabled IdentityKeys Nothing to do with usernames or heuristics, by the way. All it does is first enumerate your client keys, then let you in, then check a hu…

I had the same result, and was rather surprised. It's probably because I have a DSA key.

Aren't these published by github too?

Re: Show HN: My SSH server knows who you are

#186
post #177
post #166

Earlier quoted context omitted.

"attack"

It's an attack on privacy expectations. There are at least two ways to escalate from here: - One if agent forwarding is enabled. - Another: learning details like people's names is often a first step in social engineering.

There's also another leak which isn't really shown here and that leak is that, with just a public key, you can offer to servers and they'll tell you if it's present or not.

Using this you could scan the internet (given 6-12 hours and a shitty VPS that you can throw away this is quite possible) for someone's public key to find all of their servers, which could lead to a bypass of DDoS protection, identification of a Tor hidden service, etc.

Re: Show HN: My SSH server knows who you are

#188

FYI, this happens because SSH automatically presents a public key to the server when trying to authenticate. If the server doesn't know that key, then SSH tries the next one. You can enumerate all of someone's keys this way (like this SSH server does) If you want to disable this sort of behaviour you can disable SSH from sending keys automatically, and then tell SSH which identity files need to be sent to each host.…

Exactly! Once I get the keys I just check them against a scraped database of GitHub keys and ask the API for your name. (And if you have agent forwarding active I show you a big WARNING [0].) There's an explanation in the README [1] but the actually interesting stuff is in server.go [2]. Finally I mentioned a few reasons it might not work for you below [3]. [0] http://git.io/vOVYm [1] https://github.com/FiloSottile/w…

And now I've rotated my keys and fixed my ssh config file. Thanks :-)

Re: Show HN: My SSH server knows who you are

#189

Earlier quoted context omitted.

Exactly! Once I get the keys I just check them against a scraped database of GitHub keys and ask the API for your name. (And if you have agent forwarding active I show you a big WARNING [0].) There's an explanation in the README [1] but the actually interesting stuff is in server.go [2]. Finally I mentioned a few reasons it might not work for you below [3]. [0] http://git.io/vOVYm [1] https://github.com/FiloSottile/w…

> (And if you have agent forwarding active I show you a big WARNING [0].) It amazes me that people enable that for random servers. Seems like SSH should make that harder. Enabling it for a specific server you trust makes sense; enabling it for all servers doesn't. SSH could reject "ForwardAgent" outside a Host block, for instance, and force you to at least write a "Host *" block. EDIT: Check out this search: https://…

There's something I found on hacker news awhile back that can allow you to use ForwardAgent while limiting your identities so that you can forward your ssh agent, but it only forwards the identity you used to connect to that server. It starts up a separate agent for each identity when you invoke it.

You can find it at: https://github.com/ccontavalli/ssh-ident

Re: Show HN: My SSH server knows who you are

#190
post #181
post #99

I use different keypairs for different trust domains. (also makes it easier to hand over access when you quit a job.) SSH keys are actually pretty horrible from a security perspective; no expiration, generally held in software, etc. And without a lot of work, single-factor. I love the ssh security model of being pretty good and better than telnet for everything (which it ~fully displaced, unlike https vs. http), but…

> And without a lot of work, single-factor. Wouldn't a passphrase be a second factor? By the way, we use a security fob at work for that. Seems to work fairly well. The private key never leaves the fob, you have to press a button to sign anything, and every once in a while you have to enter your passphrase.

passphrase is set/unset locally and not communicated to the server if it is present/used/etc. Could be disabled. along with various other things.

HW token with ssh key inside is probably the best. The annoying thing is devices w/o USB. For iOS devices and android devices which support it it's probably better to just use the HW sec features. Something which did bt 4.0le and maybe had a single local LED and button would be better still.

Post reply on HN