r/programming • • Aug 03 '16

Why aren’t we using SSH for everything?

https://medium.com/swlh/ssh-how-does-it-even-9e43586e4ffc#.frpyqvaaf
194 Upvotes

71 comments sorted by

76

u/MindStalker Aug 03 '16

"On the other hand, SSH does have several cool features over HTTP/2 though, like built-in client authentication which removes the need for registration and remembering extra passwords."

HTTPS has had this for a long time, you can load a certificate in your browser which will log you into a website. Very very few sites support this, but the technology exist.

23

u/atakomu Aug 03 '16

Governments usually use this. At least our does. You first need to load government certificate so that site certificate is recognized as valid and you are logged in with your personal certificate. You can use it to fill taxes or get new passport etc.

But sadly browser support isn't great for signing stuff with certificates so you need to use java plugins which break usually when new browser version is out and will stop working probably when NPAPI won't be supported anymore in browsers.

14

u/Nastapoka Aug 03 '16

At least our does

and yours = ?

18

u/atakomu Aug 04 '16

Slovenia E-government here isn't perfect but It kinda works. It probably doesn't help that the country is shaped like a chicken :)

5

u/aazav Aug 04 '16

The chicken is the geometric shape of progress!

5

u/[deleted] Aug 04 '16

The US does it a lot. The DoD in particular loves their CACs.

3

u/[deleted] Aug 03 '16

Not them but I know that in France, at least some government services use this. Our equivalent of the DMV for instance, works through a website to which car dealerships can log in (with government supplied certificates) when they sell/buy a car.

→ More replies (1)

4

u/AyrA_ch Aug 03 '16

This is actually a feature of SSL/TLS and therefore every connection that uses this could be authenticated this way, provided the server doesn't ignores this, as it does most of the time.

3

u/frogdoubler Aug 03 '16

HTTPS has had this for a long time, you can load a certificate in your browser which will log you into a website

Debian SSO uses this.

1

u/[deleted] Aug 03 '16

Does HTTP/2 not support that?

1

u/happyscrappy Aug 03 '16

I use the feature on a TLS server I run too.

1

u/frezik Aug 04 '16

I've tried it for a few personal things. The interface in browsers and devices for using it tends to strongly favor security over ease of use. I understand why they did that, but it's one thing that prevents widespread adoption.

You can get equivalent authentication security to a 256 bit key by using a 20-character password with a mix of symbols on a US-standard keyboard, generated off a good random number generator, all done over SSL. Combined with a good password manager like LastPass, you don't lose much on security over SSL client certs, and gain a lot in usability.

0

u/[deleted] Aug 03 '16

[deleted]

6

u/[deleted] Aug 04 '16

It expects a lot from the people who support the users in particular. Managing a PKI, distributing and paying for certs, educating users on how to load the certs, constantly helping users who have forgotten their cert's password, etc.

I tried to use them to make it incredibly easy for my web app to authenticate users, since that company had already distributed PKCS12 certificate files for email. People just didn't want to do it, and a lot of the technologies out there like ELB in AWS completely broke it.

1

u/EntroperZero Aug 04 '16

What could we do to make it easier for end users? I think most of the trouble comes from it being kind of a pain in the ass to manage certificates in a browser.

3

u/[deleted] Aug 04 '16 edited Aug 04 '16

A hardware token that holds your certs and lots of standardized requirements like /u/_zenith mentioned.

I will say that the DoD does a lot of this with CACs, handles the loading and authentication in a standardized way, and then is able to do authorization using the person's identity.

A few downsides to this:

  • Managing hardware certs is another level of expense.

  • Managing browsers and OS support is a burden on IT and will prevent some users from using the newest browsers or even the ones they want to use. That's why a lot of DoD people were stuck on old IE versions for a while

  • Developers will absolutely pitch a fit if you require them to do PKI auth before every site. I've seen it happen. The best way to handle it is to build lots of tooling and platform that allows it to be handled easily at either a proxy layer or at a proxy webserver layer like nginx, so they don't have to implement it all from scratch every time or maintain their own libraries for each different framework.

  • Again, lots of proxies and load balancers like AWS' ELB don't forward client certificates, so you're shit out of luck if you wanted to use those

  • As an attacker, it's super easy to steal and use people's software certs. Either copy their Mozilla profile or extract their certs from the Windows cert store using something like mimikatz and now you get effortless authentication to literally every site that uses certs. Even for CACs and the like, browser pivoting in mature intrusion tools can let you run free around their web apps while the user is logged in.

In short, you need lots of buy in and investment in your IT and engineering departments to support it. The government can throw that can of time and money at it, but sometimes it's not worth the cost for a private company.

→ More replies (3)

0

u/[deleted] Aug 04 '16

[deleted]

4

u/dstutz Aug 04 '16

For example, couldn't my organization just have our own CA and we create, sign and issue all the user certs ourselves?

This is the free version of Red Hat Certificate System which RH bought from Netscape and open sourced. This is truly enterprise grade software complete with OCSP, LDAP services, Token Management. Luckily if you just spin up a CA instance it's not that complicated and you can use all the RH CS documentation which is free and awesome. It comes out of the box with a lot of profiles like web server certs, user certs, and Domain Controllers.

→ More replies (2)

0

u/[deleted] Aug 03 '16

[deleted]

2

u/dstutz Aug 04 '16

Please stop using the phrase SSL, TLS 1.0 came out in 1999 and I think you'd be hard-pressed to find things on the web that do not support it. SSL is dead.

Edit: Should have just made this top-level...

→ More replies (2)

17

u/totemo Aug 03 '16

If we have an RPC API, why not serve static files while we’re at it?

ssh static.example.com get /images/header.png

Oh I don't know... perhaps because we already have scp, or even rsync -e ssh.

11

u/Vitrivius Aug 03 '16

scp, sftp and remote rsync run on top of ssh, right?

11

u/totemo Aug 03 '16

That's rsync -e ssh. Or how about:

tar czf - | ssh [email protected] "cd dir && tar xzf -"

ssh is a Swiss Army Chainsaw.

11

u/csman11 Aug 03 '16

Modern versions of rsync are over ssh without explicitly specifying the shell.

3

u/csman11 Aug 03 '16

Yes they are. SFTP is part of SSH2 (I think it can be ran over other protocols as well, but it is an official extension to SSH).

73

u/inmatarian Aug 03 '16

So, you've rediscovered the Unix shell server. I mean, good for you, you're one of the Ten Thousand and you're about to find a lot of good shit, but ssh is the end result of a lot of other protocols that have all fallen to the wayside because people moved on to other things. unix-to-unix copying got replaced by usenet. got replaced by http. telnet got replaced by ssh. unix talk got replaced by irc, got replaced by AIM, got replaced by xmpp and gchat, got replaced by slack and whatever these days. The short of it is that Product and Service is what people flock to, not Protocol and Server.

8

u/combuchan Aug 03 '16

Seriously. Given your chat example--it's not just about chatting securely, it's about communicating. Like, when I log in I should see a thorough history of messages in a room/channel without me missing out, if somebody mentions my name in chat and I'm not logged in I should get an email.

By the time you've implemented the above, you're transcending the simple, secure shell into something proprietary.

And reimplementing sftp/scp and thinking ssh could be used instead of HTTP for the WWW is just silly for the reasons he mentions--no vhosts.

2

u/[deleted] Aug 04 '16

You can always have the best of both worlds: HTTP over SSH, which is kind of pointless, but you can get vhosts this way.

1

u/astrobe Aug 04 '16

An IRCbot on a Raspi (or on some 24/7 server) does the trick. No need for multigigabytes proprietary software.

0

u/[deleted] Aug 03 '16

[deleted]

16

u/inmatarian Aug 03 '16

Yes yes I know, I say this as I have hexchat open, connected to multiple networks and multiple channels each.

17

u/snerp Aug 03 '16

Did people use to use IRC for talking to their actual friends? I always used it for gaming/programming/tech communities, where AIM seemed to be more for just sending messages to your IRL friends.

At the least, I could never get any real life people to use IRC.

25

u/Kok_Nikol Aug 04 '16

real life people

27

u/[deleted] Aug 04 '16

Yeah? Only some people online exist in real life. You're just a computer man, for instance. You don't exist in real life. But my friends I talk to online do exist in real life (well, they would if I had friends).

9

u/the_gnarts Aug 04 '16

real life people

That’s jargon for “normal people AFK”, IIRC.

3

u/neurohero Aug 04 '16

In my day, it was mainly to bring socially awkward people together for the purpose of cybersex.

/me licks your toe.

2

u/devils_avocado Aug 04 '16

Ah yes. My very first IRC message:

randomstranger69: "Wanna cyber?"

3

u/neurohero Aug 04 '16

No "Hey A/S/L?" foreplay?

→ More replies (7)

5

u/ggtsu_00 Aug 04 '16

Yeah he forgot about ICQ

1

u/wot-teh-phuck Aug 04 '16

Not him, me

48

u/[deleted] Aug 03 '16

Another medium post, another click bait title, another set of poorly researched and exaggerated conclusions...

SSH is great, but it's not like you could just replace every other protocol with it. For one thing, it's designed for communication between two hosts who have some other means of establishing each other's identity. One of the biggest features of SSL/TLS is the public key infrastructure, which allows you to verify the person you're talking to is who they say they are without needing to ask them for a public key ahead of time. Without this feature, you wouldn't be able to securely connect to a website until someone you trust told you their public key (you could encrypt the connection, but you wouldn't be able to verify their identity). The CA system we have now is pretty complicated and has lots of issues, but without some sort of infrastructure we wouldn't be able to have the web as we know it today. (There are suggestions for replacements out there, but none have been implemented yet.)

I started to write out more of a rant but decided against it. Suffice it to say there are many other reasons why it makes sense to have two separate protocols (I'm sure other people could fill them in).

Just to be clear, the actual encryption part of SSH is fine and could be reused in SSL/TLS, but sharing most of the rest of it doesn't really make sense.

10

u/jpakkane Aug 03 '16

SSH has certificate support, roughly similar to SSL. It's just not commonly used outside big corporate data centers.

-9

u/RupeThereItIs Aug 03 '16

It's just not commonly used outside big corporate data centers.

It's used in pretty much every server/network/computer room out there.

Windows servers are pretty much the only backend system that DOESN'T use it.

For example if you're still managing your switches & routers by telnet, someone should make sure you're not able to breed.

SSH is THE secure means of remote system management, and it's more than just "big corporate data centers", though it's huge there too.

19

u/saving_storys Aug 03 '16

I think he meant the certificate system isn't used outside of datacenters, most people just use keys.

4

u/[deleted] Aug 03 '16

SSH as a protocol is just a bunch of multiplexed channels. It would make perfect sense to just implement the "HTTP" part on top of it as it is already one of most battle-tested and secure transports out there.

SSL/TLS had a metric ton more flaws regarding both protocol itself and its implementations

And the CA part could be just added. In fact, it seems someone already did

Suffice it to say there are many other reasons why it makes sense to have two separate protocols (I'm sure other people could fill them in).

Name one.

4

u/yiliu Aug 03 '16

One of the biggest features of SSL/TLS is the public key infrastructure

There's absolutely no reason you couldn't reimplement that for SSH. You've already got stuff like monkeysphere, which is basically a more flexible version of the same idea.

Anyway, the CA system for SSL is an archaic mess, and badly needs replacing. One of the leading candidates is DANE, and you've already got the equivalent for SSH.

0

u/[deleted] Aug 03 '16

[deleted]

1

u/yiliu Aug 03 '16 edited Aug 03 '16

Sure. It's just a perl script encoding a bunch of conventions. There's nothing there that SSH + GPG don't give you, except the widespread acceptance.

edit: Whoops, misread that as OpenSSL. Nevermind, that's actually pretty interesting.

2

u/loup-vaillant Aug 04 '16

One of the biggest features of SSL/TLS is the public key infrastructure, which allows you to verify the person you're talking to is who they say they are without needing to ask them for a public key ahead of time.

Well, only because we trust not-so-trustworthy certificate authorities in the first place. It's mighty convenient, but not nearly as secure as an actual web of trust.

In any case, there are probably no royal road to internet security. Seriously, people need to learn what a computer is, and how to use it.

5

u/jhzab Aug 04 '16

I'm surprised no one mentioned the rather huge overhead SSH brings to the table. I guess people don't notice it that much anymore with fast CPUs and good latencies.

1

u/[deleted] Aug 06 '16 edited Aug 06 '16

It's odd I don't see this elsewhere, last time I tested, using SSH on a VPN with medium traffic was jumping around 6-8% CPU usage compared to the 1-3% of UDP (QUIC?).

The level of complexity and features SSH has are on one side impressive, but it's also hard to believe that they don't come with notable performance (and traffic?) overhead.

6

u/spfccmt42 Aug 03 '16

SSSHHHH!!! I don't want it to get all screwed up by committee like the rest of WWW!

2

u/Sleakes Aug 03 '16

Because I don't want the http server to 100% be able to identify who I am everytime I connect? Let alone every website I go to? On top of that you still have to install your public key onto every server you go to or provide a facility that links it to an account name on the servers you mentioned. What if 2 people have the same account name, you still have to deal with creating accounts and linking them.

1

u/takvaa Aug 04 '16

This is a bit exaggerated to be honest. SSH doesn't just replace every other protocol on Earth. It's best for encryption but it's not best for other tasks mentioned in the blog post.

1

u/vriley Aug 04 '16

It's a very cool and geeky thing to do. However, regular users expect a fancy web-based frontend.

1

u/[deleted] Aug 03 '16

Probably because developers hoping to support it take a look at the reference implementation and the related OpenSSL.

→ More replies (2)

1

u/[deleted] Aug 03 '16

Because SSH involves user logins and other protocols dont?

0

u/[deleted] Aug 03 '16

[deleted]

5

u/[deleted] Aug 03 '16

This is talking about using the SSH protocol as a basis for other protocols. For instance, if you load up your browser or chat program, it would use SSH as a transport layer. End users wouldn't have to use it any more than they currently need to use curl.