Live data from Hacker News

Signing in to websites with SSH

vtllf.org

121–130 of 169 posts

Re: Signing in to websites with SSH

#121

What does "PTY allocation request failed on channel 0" mean?

When SSH clients first connect they ask the server for a pseudo terminal (PTY), to enable terminal colors, clearing the screen etc.

In this case the SSH server declines that request because it simply wants to send back one line of text. The client falls back to text mode and works fine, but issues the warning anyway. You can suppress it with `ssh -T mars.vtllf.org` like I did in the demo video.

Re: Signing in to websites with SSH

#122
post #5

I like alternative two, except that I'd have it be ssh @ auth This feels more natural to me and makes it easier to support other commands in the future should one wish to do so. Regarding the part where he said: >Running a custom SSH server along side a web server is not convenient. There is no good equivalent to the HTTP Host header, so hosting multiple SSH servers on a single IP address doesn’t work well. That's no…

Good point about the @ format, I like it much better too. You're right about tying tokens to host names, that would work. But you'd have to justify whether the extra complexity of multiple web servers preregistering tokens with a SSH front-end was worth it. Another approach would be embedding a static host identifier in the username as well. Although my knowledge of the SSH protocol isn't complete, a related issue ap…

It wouldn't be too hard to extend the SSH protocol to include something like the HTTP Host-request header. In the protocol exchange section of the SSH RFC ( https://tools.ietf.org/html/rfc4253#section-4.2 ) the format described is:

SSH-protoversion-softwareversion SP comments CR LF

In the comment section of the message, you could add something like "X-Host: hostname.wherever.org" and a smart SSH server could proxy the connection to the correct host. This happens before the key exchange occurs, so you'd still get strong authentication from having the right key.

I checked through the OpenSSH and Paramiko code, and both essentially ignore the comment section of the version exchange - everything between the first space and the CR/LF at the end. They does hold on to it for part of the DH key exchange, but they never try to interpret the bytes, so a modified client could keep sending the X-Host extension and stock OpenSSH would just ignore it.

Re: Signing in to websites with SSH

#124
post #119

Earlier quoted context omitted.

I'm not sure I understand the question. Here's what gets typed: ssh foo.example.com #uses private/public key per conf file *enter password* cd app ruby script/console irb > u = User.find_by_email "customer@example.net" irb > u.authorize_ghosting! "Reason for log goes here." * you'll want to incognito mode the URL returned here* irb > exit exit

With all due love and respect: This is something I would wrap a simple CLI around, and then kick myself in the tukhus for having ever used the language's interactive client to make raw database queries and edits on the production server.

'find_by_email' is what counts as a raw database query these days? I feel so old.

Re: Signing in to websites with SSH

#125
post #91

Earlier quoted context omitted.

Yet, if you call a public key/private key a lock/key respectively, then a lot more people would immediately get the concept. "You send him a copy of your lock which he uses to lock a package and return it to you. Then only your key can open it!" You immediately fix the problem of people sending their key, because people know keys are important and shouldn't be handed out to just anyone. The PKI people are brilliant.…

I've always wondered why we couldn't just call public keys locks. That would avoid so much confusion for first-time users.

After reading 'Why King George III Can Encrypt'[1] I really started hoping that something came of it. The metaphors they used seemed much more straightforward.

[1] https://freedom-to-tinker.com/blog/randomwalker/why-king-geo...

Re: Signing in to websites with SSH

#128
post #27

Very cool. This could be used to count linux users. Like http://linuxcounter.net/

I remember that site from years ago but it seems awfully out of date at this point.

Even the Ubuntu distro's opt-in share-my-desktop-stats system likely contains multiple times what Linux Counter is counting.

Re: Signing in to websites with SSH

#129
post #78

The author makes a very good case for why this approach won't threaten password-based authentication, including: ...hard for first-time users to get right:... The private key being unlocked and available via ssh-agent. For this to be convenient for daily use, ssh-agent is essential, and that could expose naive users to compromise. I know enough to disable ForwardAgent in my personal config by default and generate sit…

I think one solution would be for the browser (or an extension) to expose an SSH agent API through the DOM, but gate access to that agent with local UI that confirms operations. "Facebook.com would like to view your public identity information. Continue?" with an "always allow for this site" option. "Facebook.com is requesting a signing challenge to verify your public identity. Allow?" etc. It could even include an identity manager which would allow you to generate different identities to present to different sites on the fly. You could have the option of having the requests pass through to your SSH_AGENT_SOCK (still gated by UI though) if you want, or you could just let the browser maintain its own independent agent (or potentially a combination).

Re: Signing in to websites with SSH

#130
post #119

Earlier quoted context omitted.

With all due love and respect: This is something I would wrap a simple CLI around, and then kick myself in the tukhus for having ever used the language's interactive client to make raw database queries and edits on the production server.

'find_by_email' is what counts as a raw database query these days? I feel so old.

At my company, using an interactive shell on prod to invoke DB queries, even through the ORM, is basically considered a raw database query, and is strictly forbidden. It's untested code coming straight from your fallible fingers and manipulating the prod database. I don't see why this should be treated as any different than a raw db query. You can do some pretty powerfully destructive stuff with an ORM.
Post reply on HN