8 ms·
Show HN: ssh chat.shazow.net
Hi HN,
I wrote a custom SSH server in Go, give it a try. It uses your terminal user and SSH keys to authenticate implicitly. Instead of getting a shell, you get an IRC-style chatroom with everyone else.
$ ssh chat.shazow.net
If you're getting "Permission denied (publickey)", please use ssh-keygen to create a keypair. Instructions here: https://help.github.com/articles/generating-ssh-keys/
SSH is a really cool protocol; it's a lot like HTTP2. This is a demo of one thing you can do with it, but I plan to factor out the code into libraries that will let you build all kinds of experiences that can be used with any SSH client.
The source code is here: https://github.com/shazow/ssh-chat
(Should be reasonably stable and handle thousands of connections, but apologies in advance if it crashes: Try to reconnect in a minute.)
- cmyr 12y agothis is really cool even if you're all jerks.
- shazow 12y agoI know, right? I got silenced on my own server. <3
- kirillzubovsky 12y agoGot kicked out for not saying anything for 5 minutes. Kind of a bummed :) Would be nice to see if that was an auto-kick by the server, or someone actually kicked me out for kicks. There was no info other than [disconnected by remote server].
- shazow 12y agoNah, that's just the server restarting. :) There's a bug where it hangs sometimes, haven't quite figured it out.
- chatmasta 12y agoWell then it sounds like a viable competitor to IRC!
- bob917 12y agoI just hope everyone is a gentleman like me and trolls are promptly dealt with.
- Aloha 12y agoneat!
- codezero 12y agoReminds me of the good old days of telechat. I was wondering if there was a way to set up a "login" free SSH server, glad someone else figured it out :)
- shazow 12y ago:D Yea, the protocol certainly allows for it. Glad you like it.
- motyar 12y agoHow to exit?
- gatehouse 12y ago"/exit" There is also a way to force your ssh client to disconnect: http://askubuntu.com/questions/29942/how-can-i-break-out-of-ssh-when-it-locks http://askubuntu.com/questions/29942/how-can-i-break-out-of-... Edit, although now I can't seem to reconnect.
- kolev 12y agoWith "/exit".
- limedaring 12y agoYou can also access other commands with "/help".
- valleyer 12y ago^D works
- mappu 12y agoCool! Can you hook a full ncurses up to this? Going by my input lag, it looks like all keypresses are sent to the server, can you implement readline somehow or can i configure SSH to buffer input locally? Cook terminal mode or something? What's pty.go used for? If i write a line that's longer than my terminal width, it wraps onto a second line, but new incoming messages obscure the first line
- shazow 12y ago> Can you hook a full ncurses up to this? Yup! Any ncurses thing should work great. I couldn't find a golang curses lib that doesn't hardcode to stdout except for crypto/ssh/terminal, but it's fairly limited. > Going by my input lag, it looks like all keypresses are sent to the server, can you implement readline somehow or can i configure SSH to buffer input locally? Cook terminal mode or something? I believe that's up to your ssh client. There are things like https://mosh.mit.edu/ https://mosh.mit.edu/ which try to mask the latency. > What's pty.go used for? For bootstrapping the pty request/response. :) > If i write a line that's longer than my terminal width, it wraps onto a second line, but new incoming messages obscure the first line Yea, there's a bug with long line reflow, not sure how to fix it. :(
- Scaevolus 12y agoYou could probably write raw ANSI escape sequences -- they're essentially universal by this point. http://en.wikipedia.org/wiki/ANSI_escape_code http://en.wikipedia.org/wiki/ANSI_escape_code ncurses is overkill nowadays when everything is a (VT100) emulator.
- shazow 12y agoYup, that's how most of these curses libraries work. It's a lot of work doing layout with straight up escape sequences, though.
- Scaevolus 12y agoCompatibility is most of the complexity: http://invisible-island.net/ncurses/terminfo.ti.html http://invisible-island.net/ncurses/terminfo.ti.html
- _RPM 12y agoHave you implemented the binary protocol? Where did you get the protocol specification from?
- shazow 12y agoIt's using Go's crypto/ssh from the standard library.
- jensenbox 12y agoWhy not tunnel IRC through this and get all the benefits of a seasoned IRC server?
- edibleEnergy 12y agohah cool
- tux 12y agoThis should be called "SIRC" ^_^ If anyone else has "Permission denied" run this command: ssh-keygen -t rsa -f ~/.ssh/id_rsa
- zifnab06 12y agoReminds me of the old ircii days. Very basic client, I like it!
- shazow 12y agoA not-so-subtle reminder to people who are "curious" and want to break things: It's open source. Install it locally and break it to your heart's content. If you're flooding the public server, you're just ruining it for everyone else. Yes, there are no spam controls. Yes, there are bugs. This thing was built in a couple of days on my free time, and here I am sharing it with you. Please find bugs locally, fix them, and send a pull request. Enjoy. :)
- scrollaway 12y agoAwesome work. I love it. I really think that this sort of thing could be extremely useful in some specific cases, for example for internal communication from sysadmins in enterprise setups. Imagine if it could be integrated along with the shell, say in an ncurses split window or something like this. There's so much potential. Great work!
- tsmith 12y agoDoesn't work with SSHInATab - I can connect (after adding a keypair) but the things I type don't show up :'(
- flac 12y agoA little warning: You should turn off SSH Agent Forwarding for this host. Otherwise it may use your SSH Keys to auth to other servers you connect to via SSH, e.g. GitHub git access etc. You can either disable it for a particular session via -a argument: $ ssh -a chat.shazow.net Or permanently for this host in ~/.ssh/config: Host chat.shazow.net ForwardAgent no
- shazow 12y agoThat sounds like a fun hack, thanks! Wonder if it will work, will play with it later. :) Do any clients have it on by default? (If you'd like to take my word for it, I have no intention on doing this on chat.shazow.net)
- mercora 12y agoif you use an agent, you can turn on confirmation for usage of the key with "ssh-add -c" it will prompt using SSH_ASK_PASS... I always do that and i think its always a good measure. of course always turning on agent forwarding is non the less a bad idea :D
- Kiro 12y agoCan someone post a screenshot?
- shazow 12y agoHere's a screenshot somebody took of it running on a Cathode terminal: https://twitter.com/shazow/status/543587063765823490 https://twitter.com/shazow/status/543587063765823490 We've had some pull requests since then which add colors and other things.
- chuckup 12y agoAdd some ANSI color, a message board section, stir, and you've got a BBS! k-rad!
- medecau 12y agoUsername "dump" flooded the server. Service is dead until restart.
- nathell 12y agoA log, updated live until something kicks my 'watchdog' session out: http://danieljanus.pl/hnchatlog.html http://danieljanus.pl/hnchatlog.html
- nathell 12y agoThis is how it's generated: https://gist.github.com/anonymous/055a8fc90419b5beb9ba https://gist.github.com/anonymous/055a8fc90419b5beb9ba
- DLion 12y ago
- deleted 12y ago[deleted]
- jimnutt 12y agoVery interesting, although it seems to be broken at the moment. It connects and then just kind of hangs (connecting with the latest SSH client in arch). It's a cool concept though.
- aksx 12y agoSome people are spamming the chat room which increases the memory usage and causes the 'hanging' The server is restarted every hour so you should be able to access it in a while. The flood control feature has been added, we are waiting for shazow to wake up and update the binary.