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 `wall` I think would work, but I have never been able to get that to work.<p>I am on Mac OS X, and ideally I could do this without installing other software, using something built in.
Just use tail -f and a bash function.<p>Put this in your .bashrc file:<p><pre><code> function talk { echo "$USER: $@" >> talkfile; }
</code></pre>
then run:<p><pre><code> tail -f talkfile &
</code></pre>
The & puts tail into the background so it continues running, and "talkfile" needs to be a file that both of you have write access to.<p>You can both communicate simply by using the talk function like any other bash command:<p><pre><code> talk whatever you want and it'll be written to talkfile
</code></pre>
This works on Linux, not sure about Mac.<p>It's nice because it records what you say, so there's no need for the other person to be logged in to get your message, and you get a printout of the last few lines of conversation when you "login" (run the tail -f command). There's nothing extra to install either.<p>(edit, apparently say is already installed on OS X, so I renamed the function "talk")
I wrote this for use on a client project for a client I'm pretty sure won't consider this a breach of anything.<p><pre><code> #!/bin/bash
# Simple chat system for when Skype is fucked.
nick=${1?Usage: $0 nickname (e.g. $0 biturd)}
chan=/tmp/yapchan
echo "^D to exit chat." >&2
tail -F "$chan" & tailpid=$!
trap 'kill "$tailpid"' 0
while IFS='' read -er line; do echo "<$nick> $line"; done >> "$chan"
</code></pre>
If you're running this with multiple accounts, you may need to chmod a+w /tmp/yapchan, and if you're using MacOS on the server, you may need to use a different filename since MacOS has a per-user private /tmp.
talk has been around for like...30 years now:<p><a href="https://en.wikipedia.org/wiki/Talk_(software)" rel="nofollow">https://en.wikipedia.org/wiki/Talk_(software)</a>
I actually really miss the user experience of 'talk' and 'ytalk'. Split-screen so people really could type at the same time, and touch-typists could type at the same time as reading what the other person was writing. Character-by-character, too, which helped improve the feeling of connection.
A lot of nice solutions have already been posted for talking. If you want to show some code, a shell session, your dwarf fortress, etc., you can look at screen/tmux with a shared guest account:<p><pre><code> # you type:
$ screen -S session1 vim file.txt
# and they can type (as the same user)
$ screen -x session1
# or with tmux, you type:
$ tmux new -s session1 vim file.txt
# they type (as the same user)
$ tmux a -t session1
</code></pre>
You can try it out with two terminals on your own.
I seem to recall this being on HN a few months ago:
<a href="https://github.com/shazow/ssh-chat" rel="nofollow">https://github.com/shazow/ssh-chat</a>
While linux x86_64 only, this is precisely why I built sshtalk -- <a href="https://2ton.com.au/sshtalk" rel="nofollow">https://2ton.com.au/sshtalk</a>, or just ssh 2ton.com.au to see for yourself, I leave it open as a public/free service
There should be a service which does throwaway accounts for ssh or ssh-via-web access with some extremely limited functionality, like talk, to keep the multiuser UNIX dream alive.<p>Maybe even spin up VMs on demand based on new hostname (if not seen before). First to claim = own. Some rate limiting function.<p>Shell accounts largely went away due to ease of use, but also local user exploits and abuse, but enh. If you virtualized the network (so you could reroute through a new IP on abuse, or let users own the IP) and restricted functionality it wouldn't be as bad.<p>No practical purpose, just fun.
We do this all the time, at-least for past 5 years or so while implementing our opensource project.<p>We login to same server to do :<p>#create a screen<p>screen -S chat<p>#Both of us will join the screen:<p>screen -x chat<p>#Now we can see each other typing. Make typing easier do:<p>write pts/<id> username<p>#Make sure there is another login and use that pts <id> above.<p>After we typed our lines, to indicate I'm waiting for his response. I'll adding 2 or 3 newlines.<p>That's it ! :)Simple chat over ssh.
You can't connect ssh clients like you would modems. If the machines are on a public network you ssh to another person's sshd, then use terminal chat programs. If you're both behind a NAT, one of you needs to port-forward to your host's sshd, or use STUN, TURN or ICE servers, or maybe just IPv6.<p>Once connected to someone's host, use the Talk program (<a href="https://en.wikipedia.org/wiki/Talk_%28software%29" rel="nofollow">https://en.wikipedia.org/wiki/Talk_%28software%29</a>), or the Write program (<a href="https://en.wikipedia.org/wiki/Write_%28Unix%29" rel="nofollow">https://en.wikipedia.org/wiki/Write_%28Unix%29</a>), or use Netcat (<a href="http://hak5.org/episodes/haktip-82" rel="nofollow">http://hak5.org/episodes/haktip-82</a>) to open a two-way dialogue between terminals. Netcat is the simplest of them all because it just opens a two-way tcp session, and technically only one of you needs netcat while the other just needs a telnet client or equivalent.
When you say "they to me" it makes it sound like you want a peer-to-peer connection. Unless your internet service allows unsolicited incoming connections, then you will need to do NAT piercing. And if you are behind the same NAT (e.g., same ISP) then you will have to forward traffic through some third host who is not behind the NAT.<p>But when you mention "wall(1)" it makes it sound like you want to connect to some internet accessible UNIX host via ssh and chat to others who are also connected to that host.<p>Option 2 would be less complex.<p>Depending on what software is installed on the host you connect to, there are many possibilities. Back in the old days, talk(1) could be used for split screen chats. Today, tmux(1) would be my choice. Anything that uses UNIX domain sockets could work.<p>Proof of concept:<p>Does Darwin have logger(1), syslogd(8) and /etc/syslog.conf(5)?<p>Decide where to log the messages, e.g., /var/log/messages<p>Edit /etc/syslog.conf<p>Start syslogd<p>logger "your message"<p>less /var/log/messages<p>less -F /var/log/messages<p>tail -f /var/log/messages<p>Messages have date, time, priority (if any) and hostname.<p>You said "something basic"; this is about as basic as it gets.
man write<p><a href="http://ss64.com/bash/write.html" rel="nofollow">http://ss64.com/bash/write.html</a><p>You would need to run two instances of write : you would write to your friend and your friend would write to you.<p>Just press Enter twice when you are done with your turn (I.e. "over" as in, transmission over)
write anybody?? I must be too old for this shit then.<p>just write <systemusername> <tty|ptsname>
enter message and quit with ctrl-d<p>from man page:<p><pre><code> DESCRIPTION
The write utility allows you to communicate with other users, by copying lines from your terminal to theirs.
When you run the write command, the user you are writing to gets a message of the form:
Message from yourname@yourhost on yourtty at hh:mm ...
Any further lines you enter will be copied to the specified user's terminal. If the other user wants to reply, they must run write as well.
When you are done, type an end-of-file or interrupt character. The other user will see the message ‘EOF’ indicating that the conversation is over.
You can prevent people (other than the super-user) from writing to you with the mesg(1) command.
If the user you want to write to is logged in on more than one terminal, you can specify which terminal to write to by specifying the terminal name as the second operand to the write command. Alter‐
natively, you can let write select one of the terminals - it will pick the one with the shortest idle time. This is so that if the user is logged in at work and also dialed up from home, the message
will go to the right place.
The traditional protocol for writing to someone is that the string ‘-o’, either at the end of a line or on a line by itself, means that it is the other person's turn to talk. The string ‘oo’ means
that the person believes the conversation to be over.</code></pre>
<a href="http://www.redbrick.dcu.ie/~c-hey/" rel="nofollow">http://www.redbrick.dcu.ie/~c-hey/</a><p><pre><code> 1. Install that on a machine.
2. Both SSH to the that machine machine.
3. Type: `hey <username>`, press enter.
4. Enter your (optionally multiline) message to your friend.
5. CTRL+D (on windows, at least) to send the message.
6. ????
7. Profit.</code></pre>
Use Paramiko (Python) to code a quick server based on :
demo_server.py
Share what is typed between clients using fifo, shared file (bad!) or SQLite.
See: <a href="https://github.com/paramiko/paramiko/blob/master/demos/demo_server.py" rel="nofollow">https://github.com/paramiko/paramiko/blob/master/demos/demo_...</a>
I highly recommend ytalk, available as a package in most repos, as the solution here. Not only does it support multi user chat across the network (you can send talk requests to user@host), it has a shell escape feature which means you can open a vim buffer inside your chat session for collaborative editing.
An easy way is to just create a new screen (see the Unix command "screen") and then open a text editor in it. The second participant then joins the screen (via screen -x) and now you both can type into the same editor.
It might not be exactly what you're looking for but you might take a look at <a href="https://github.com/DSUOSS/unix-chat" rel="nofollow">https://github.com/DSUOSS/unix-chat</a>.
I'm working on a secure chat client that runs in a browser (so nothing to install). If you're interested in being a beta tester send me your email address and I'll send you an invite.
I'm a huge fan of not using the system chat tools for this but to write your own chat client. But instead of a simple text file I'd use a small database like sqlite or a logger because I want to make sure that the chatters don't run into the trouble of fighting for the write access to that file. Also if you do this a few weeks the file might get that big, that you would like a database engine to parse it anyway.<p>PS: Huge kudos for the question, btw. This is the kind of stuff that really improves your ability to use your system well.
Lots of custom solutions in this thread, but there's already inbuilt commands for talking installed by default on every Unix box.<p>Log into a box, use 'who' to see which terminal they're using, and use 'write' to send a message there.<p>Or be lazy and just use 'wall' (write all) like I do.
Despite the fact that you both have SSH, you can still pick up the phone and call them. :)
+1 for write.
<a href="http://www.computerhope.com/unix/write.htm" rel="nofollow">http://www.computerhope.com/unix/write.htm</a>
netcat to the rescue!<p>You run:<p><pre><code> nc -l 5000</code></pre>
They run:<p><pre><code> ssh [yourhost] nc localhost 5000
</code></pre>
The only issue I see is that you apparently can't get netcat to only listen on localhost so others could join in in theory.
I'm not sure about OS X but most Linuxes have netcat installed.<p>There's also OpenSSL s_client/s_server for an encrypted connection, although you need to setup some certificates first.
You could use this: <a href="https://github.com/kryptographik/ShuSSH" rel="nofollow">https://github.com/kryptographik/ShuSSH</a>
check the following *nix utilities:<p>ssh one box to another, then:<p>who -uT // show who is connected to a machine and will they recieve message sent with write or wall command<p>write // sends a message to another user (tty). dont do this as it can confuse the other user by inserting the message in the middle of his current output.<p>wall //send a msg to all of the logged in users<p>talk & talkd // client and server. (old school rulz!)
unix command: kibitz<p>kibitz - allow two people to interact with one shell<p><a href="http://www.skrenta.com/rt/man/kibitz.1.html" rel="nofollow">http://www.skrenta.com/rt/man/kibitz.1.html</a>
This does not directly answer your question.
But there is a way using third party software.<p>You can use "<a href="https://telegram.org"" rel="nofollow">https://telegram.org"</a> telegram messsenger.<p>It works flawlessly from the cli.<p>Yes, you cannot use it if you don't want your chats to pass through a third party server.
But maybe you can try out the "secret chat" feature with auto destroy feature.<p>The traditional options have already been listed by others here. I just wanted to tell something which is easy to setup and also reliable.