SScHat - a Chat Application Build Using Native Linux Command-line Tools
A while back I read the following question on HN (Hacker News):
Ask HN: I have ssh, they have ssh, how can we chat?
I don’t want a dedicated client, I want to go back to the old ways of modem to modem over VT100 links and chatting that way. How can I ssh to another machine, or they to me, and we run a cli app that allows us to chat, something basic like
wallI think would work, but I have never been able to get that to work.
I am on Mac OS X, and ideally I could do this without installing other software, using something built in.
It’s a cool question, mostly because Unix has some great build-in tools that have proven themselves over the last few decades. So, is it possible to make a chat application with (native) Unix tools?
SScHat – pronounced ‘shat’ (the ‘c’ is silent) – is nothing more than a few bash scripts that use the following Unix tools:
* I’m aware that ‘screen’ is not native to all Unix distributions. Yet, it’s a very common tool and I’m quite confident most of you already have ‘screen’ installed. But if you are a stickler for the rules: you can run SScHat without ‘screen’. You’ll just have to open up two terminals, one running
read.sh and the second one running
So how does it work?
The concept behind SScHat is probably one of the most basic designs for a chat applications you’ll every see. All it does is:
- It creates a text file on the server (if it doesn’t exist already).
- It runs a
less +Fover SSH on your conversation file creating your ‘read’ screen.
- And runs
echo 'message' >> $CONVERSATION_FILEover SSH when sending a message.
To get started all you have to do is:
- Allow a (new) user – simply add their public key to
~/.ssh/authorized_keys– to SSH into the server where you want to store the conversation(s).
- Adjust the settings in
./sshchaton the client.
As I said before, the main goal here was just to see if it was possible. But, anyone looking for a serious communication tools will (and should) immediately dismiss SScHat. Mostly because of it’s lack of features and missing ‘conversation integrity’. However no one can argue with me about the proven quality of the underlaying SSH library responsible for the end-to-end encryption ;)