11 ms·
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 `wall` I 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.
- andrewchambers 11y agoit could be done with a fifo, I believe the command "write" also does this.
- opless 11y ago+1 write Also you could install an irc server, bind it to localhost, and have a slightly better user experience.
- chx 11y agoAn IRC server for this? Thermonuclear flyswatter.
- opless 11y agoTrue, but more scalable when you want a realtime text conversation with more than two people.
- JustSomeNobody 11y agoAlready talking about scaling and we're not even sure it needs to scale... ;)
- pwg 11y agoman talk
- NeutronBoy 11y agoNot sure if it's installed by default on OSX, but you could use screen/byobu/tmux to share a terminal session and type to each other.
- rdl 11y agoThere 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. Maybe even spin up VMs on demand based on new hostname (if not seen before). First to claim = own. Some rate limiting function. 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. No practical purpose, just fun.
- stock_toaster 11y agoAs pwg@ mentioned, talk is worth looking at. Check the man pages for `mesg` and `talk` and `write`.
- agartner 11y agoIt might not be exactly what you're looking for but you might take a look at https://github.com/DSUOSS/unix-chat https://github.com/DSUOSS/unix-chat.
- philprx 11y agoUse 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: https://github.com/paramiko/paramiko/blob/master/demos/demo_server.py https://github.com/paramiko/paramiko/blob/master/demos/demo_...
- alcari 11y agoI seem to recall this being on HN a few months ago: https://github.com/shazow/ssh-chat https://github.com/shazow/ssh-chat
- strathmeyer 11y agoHave we forgotten about Zephyr?
- joshu 11y ago> without installing other software
- rdl 11y agoIt's just kerberos/hesiod/afs/moira/etc. plus zephyr, third-party client, config files, etc. That doesn't even count as "installing other software", really. Oh, and cross-realm keys with any site you want, etc. (I guess you could run Zephyr with somewhat less than that, and maybe it has improved in the past 15y for small deployments, but, when I tried in 2001 it was insane)
- joshu 11y agoNo.
- JamesMcMinn 11y agoJust use tail -f and a bash function. Put this in your .bashrc file: function talk { echo "$USER: $@" >> talkfile; } then run: tail -f talkfile & 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. You can both communicate simply by using the talk function like any other bash command: talk whatever you want and it'll be written to talkfile This works on Linux, not sure about Mac. 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. (edit, apparently say is already installed on OS X, so I renamed the function "talk")
- wampus 11y agoYou definitely don't want to name the alias 'say' because there's already an OS X command by that name. In fact, if you both have Macs and want to have some fun, create accounts for each other and use the 'say' command to use the speech synthesizer for chat. You can even choose different voices: man say
- aaronharnly 11y agoNice suggestion! Just to note, on the Mac there's already a /usr/bin/say, which invokes the text-to-speech. So if you don't create your function, SSHing to the friend's Mac and typing 'say whatever you want' will have an interesting but probably not desired effect :) I'll admit to having used this on a friend's machine once or twice for amusement. (And invoking 'say' invokes the TTS even if you SSH in as a user other than the one logged in to the main GUI. I'm pretty sure this wasn't always the case; not sure when it changed.)
- madeofpalk 11y ago> (And invoking 'say' invokes the TTS even if you SSH in as a user other than the one logged in to the main GUI Been this way since at least 2008 - I remember doing this back in school when bored in class.
- 11y ago
- cornellwright 11y agoAn 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.
- atxhx 11y agoI remember netcat being installed on OS X by default, you could ssh in and run it or pipe the port through ssh.
- schoen 11y agoTo be slightly more explicit for people who aren't used to using it this way, one person could run "netcat -l 12345" and the other could run "netcat localhost 12345". (Your netcat might also be installed as nc.)
- kragen 11y agoI wrote this for use on a client project for a client I'm pretty sure won't consider this a breach of anything. #!/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" 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.
- kragen 11y agoIf anybody is using this and encounters bugs, I’d be happy to hear them. I did my best to make it work reliably.
- joshu 11y agossh to the same machine. $ mesg y $ talk <otherusername>
- userbinator 11y agoI'm not sure about OS X but most Linuxes have netcat installed. There's also OpenSSL s_client/s_server for an encrypted connection, although you need to setup some certificates first.
- wrayjustin 11y agoOr if you're okay with less encryption-strength, `cryptcat`.
- rickr 11y agotalk has been around for like...30 years now: https://en.wikipedia.org/wiki/Talk_(software) https://en.wikipedia.org/wiki/Talk_(software)
- drincruz 11y agoI used to love talk. No holding back with thoughts since they see you typing immediately. 8)
- omaranto 11y agoI really liked the talk idiom where you first typed something rude, then slowly erased it one letter at a time, and finally typed a euphemism. Like what people use strikethrough for now, but it was funnier in talk somehow.
- mverwijs 11y agoOnly idio^H^H^H^Hnice people use talk!
- kazinator 11y agoTalk is great because people can complete each other's sentences and such, which is impossible with instant messaging (unless people hit send for incomplete thoughts).
- nl 11y agoAnd YTalk for multi-way chat: http://linux.die.net/man/1/ytalk http://linux.die.net/man/1/ytalk
- tunesmith 11y agoI 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.
- Jtsummers 11y agoWith ytalk you could escape to the shell and the other participants could see what you were doing. It was fantastic for showing classmates code I was working on.
- rbc 11y agoWRITE(1) is pretty much ubiquitous. Even Mac OS X has it. Very old school.
- ctpide 11y agoyes, I have recently seen it being used in a movie. I think it was in Blackhat :D
- fizgig 11y agoI recall that on the Dynix (Sequent?) and SunOS lab workstations back in college (early 90s), users' TTYs had pretty open permissions. One could echo a message and redirect directly to your buddy's TTY. Also good for blasting annoying users from their session -- cat'ing binaries or chargen output was often enough. There's something to be said of the old-school wonder of fingering random machines on the internet (say, from one's email bang path) for logged-in users then initiating talk sessions.
- chrisper 11y agoYou can also create a screen session. The other user logs into your ssh server and uses screen -x to attach to your terminal.
- yueq 11y agotalk user@host
- thirdreplicator 11y agoUser A logs into user B's machine. User A or B types screen -S chat The other user types screen -xr chat
- wyc 11y agoA 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: # 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 You can try it out with two terminals on your own.
- michaelmior 11y agoThis probably isn't want the OP wants, but this seems like a good spot to put in a plug for tmate[0]. There's not much to it but basically it provides a remote tmux server to share your current terminal. If you use their public server, you just run tmate and it spits out a randomly generated SSH connection string. The code is open source, so you can run your own server if you choose. [0] http://tmate.io/ http://tmate.io/
- wyc 11y agoVery cool! I like the presentation on the landing page a lot. It's immediately apparent what it does. The most difficult part of using this for me seems to be trusting tmate--not that tmate is inherently untrustworthy, but IMO untrustworthy by default is a good policy.
- michaelmior 11y agoWell, the code is open source so you can go over it and compile from source if you want. The server is also open source, so you can run your own if you're concerned about the public server.
- wyc 11y agoNice! I'm sorry I missed that.
- StavrosK 11y ago
- brajesh 11y agoWhat's wrong with using 'wall'
- ised 11y agoWhen 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. 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. Option 2 would be less complex. 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. Proof of concept: Does Darwin have logger(1), syslogd(8) and /etc/syslog.conf(5)? Decide where to log the messages, e.g., /var/log/messages Edit /etc/syslog.conf Start syslogd logger "your message" less /var/log/messages less -F /var/log/messages tail -f /var/log/messages Messages have date, time, priority (if any) and hostname. You said "something basic"; this is about as basic as it gets.
- 2ton_jeff 11y agoWhile linux x86_64 only, this is precisely why I built sshtalk -- https://2ton.com.au/sshtalk https://2ton.com.au/sshtalk, or just ssh 2ton.com.au to see for yourself, I leave it open as a public/free service
- tanderson92 11y agoThanks, this is great! Any hope that it will eventually support split-screen for personal chats, as ytalk does?
- 2ton_jeff 11y agoI opted out of split-screen in favour of inline with formatting and different colours... I always found it difficult to follow the split screen chats way back then ... that and it makes multi-person windows more difficult with smaller terminal sizes :-)
- tanderson92 11y agoMakes sense! My dad and I have been using it for our instant messaging. We were curious how possible it would be to have timestamps on messages. I suppose we could reprogram the ASM, but x86 ASM is a little inaccessible :)
- 2ton_jeff 11y agoI really didn't expect for it to carry any social features or aspects, in fact the reason I built it was so that it was a ephemeral as I knew how to make it. Timestamps contravene this goal a bit... but if you are genuinely interested re: same, the mods to sshtalk would be quite trivial to add. Despite it being assembler, it is very easy.
- sgt 11y agoI had very low expectations of this until I ssh'd into 2ton.com.au. Wow, this is fantastic. It really brings my mind back into the BBS days.
- atsaloli 11y agoman write http://ss64.com/bash/write.html http://ss64.com/bash/write.html You would need to run two instances of write : you would write to your friend and your friend would write to you. Just press Enter twice when you are done with your turn (I.e. "over" as in, transmission over)
- db48x 11y agoinstall talk on one of your machines.
- ctpide 11y agotalk is already build-in under Mac OS X
- roka88 11y agouyu
- Animats 11y agoMandatory XKCD: https://xkcd.com/949 https://xkcd.com/949
- drKarl 11y agoYeah, I remember that xkcd. It would be nice if there was the publishing date so that we can have a better context...
- icebraining 11y agoIt has the dates in the archive[1], by hovering the links. That particular comic was published in 2011/09/09.
- joelthelion 11y agoStill no improvements on this front.
- icebraining 11y agoIf it's for file transfer (not long-term storage), MEGA is pretty nice. No registration required, clean and ad-free UI, supports huge files, etc.
- kenrick95 11y agoPeer-to-peer file transfer or torrent over webRTC (webTorrent) maybe? https://instant.io/ https://instant.io/
- panglott 11y ago"Oh, your DropBox is full? Ok..."
- giis 11y agoWe do this all the time, at-least for past 5 years or so while implementing our opensource project. We login to same server to do : #create a screen screen -S chat #Both of us will join the screen: screen -x chat #Now we can see each other typing. Make typing easier do: write pts/<id> username #Make sure there is another login and use that pts <id> above. After we typed our lines, to indicate I'm waiting for his response. I'll adding 2 or 3 newlines. That's it ! :)Simple chat over ssh.
- c22 11y agoYou could use this: https://github.com/kryptographik/ShuSSH https://github.com/kryptographik/ShuSSH
- resca79 11y agotry `write`: >usage: write user [tty]
- lisper 11y agoI'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.
- silverwind 11y agonetcat to the rescue! You run: nc -l 5000 They run: ssh [yourhost] nc localhost 5000 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.
- y0ghur7_xxx 11y ago> get netcat to only listen on localhost nc -l 127.0.0.1 5000
- Ded7xSEoPKYNsDd 11y agoThere are many netcats, some of them can bind to localhost. ncat (Nmap's nc) even has a --chat option for multi-party chats. It also has SSL options, so you could just throw the ssh away and use it exclusively.
- peterwwillis 11y agoYou 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. Once connected to someone's host, use the Talk program (https://en.wikipedia.org/wiki/Talk_%28software%29 https://en.wikipedia.org/wiki/Talk_%28software%29), or the Write program (https://en.wikipedia.org/wiki/Write_%28Unix%29 https://en.wikipedia.org/wiki/Write_%28Unix%29), or use Netcat (http://hak5.org/episodes/haktip-82 http://hak5.org/episodes/haktip-82) 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.
- gko 11y agoIf you are using the same account: emacs --daemon (once), emacsclient -t (for everyone).
- danielhunt 11y agohttp://www.redbrick.dcu.ie/~c-hey/ http://www.redbrick.dcu.ie/~c-hey/ 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.
- sturmeh 11y agoRun an irc bouncer like ZNC, they usually have a partyline plugin/functionality that lets you chat as if you were on an irc server, but locally.
- mayli 11y agoYou can use write or screen/tmux.
- kpcyrd 11y agoapt-get install nmap ncat --chat -lp 1234
- ninjakeyboard 11y agoDespite the fact that you both have SSH, you can still pick up the phone and call them. :) +1 for write. http://www.computerhope.com/unix/write.htm http://www.computerhope.com/unix/write.htm
- girish_h 11y agoYou could ssh into another machine, run a screen session, launch a shell and start chatting inside the shell
- madaxe_again 11y agoI'm surprised nobody has mentioned "wall". Not great for chatting but damnably useful for unmissable comms with others on a box.
- saurik 11y agoThe OP specifically said "something basic like `wall` I think would work, but I have never been able to get that to work", and there are multiple other comments mentioning wall.
- erikb 11y agoI'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. PS: Huge kudos for the question, btw. This is the kind of stuff that really improves your ability to use your system well.
- vectorEQ 11y agotunnel netcat through SSH :D for fun, but probarbly not profit!
- nailer 11y agoLots of custom solutions in this thread, but there's already inbuilt commands for talking installed by default on every Unix box. Log into a box, use 'who' to see which terminal they're using, and use 'write' to send a message there. Or be lazy and just use 'wall' (write all) like I do.
- enterx 11y agocheck the following *nix utilities: ssh one box to another, then: who -uT // show who is connected to a machine and will they recieve message sent with write or wall command 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. wall //send a msg to all of the logged in users talk & talkd // client and server. (old school rulz!)
- Shalle 11y agoopen up a screen session and type whatever you want.
- kichuku 11y agoThis does not directly answer your question. But there is a way using third party software. You can use "https://telegram.org" https://telegram.org" telegram messsenger. It works flawlessly from the cli. 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. The traditional options have already been listed by others here. I just wanted to tell something which is easy to setup and also reliable.
- dorfsmay 11y agoDoesn't telegram require that you use a cell phone number to register? OP wants to have ssh as the only requirement.
- plg 11y agounix command: kibitz kibitz - allow two people to interact with one shell http://www.skrenta.com/rt/man/kibitz.1.html http://www.skrenta.com/rt/man/kibitz.1.html
- fsniper 11y agowrite anybody?? I must be too old for this shit then. just write <systemusername> <tty|ptsname> enter message and quit with ctrl-d from man page: 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.
- tootie 11y agoThat was always a fun time. At my college, ttys were globally writable by default for some reason. Once when a professor was demoing something in front of class on his terminal, a few of the haxx0rs slipped out to the computer lab to bomb his tty with ascii art. Good times.
- astazangasta 11y agoI 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.
- alinspired 11y agoa shared screen session ? screen -x with any editor or just 'cat' running
- fstutzman 11y agoOnce you get ytalk running, the next step is to install colossal cave adventure.