How to Setup Secure Private Chat Server with Ytalk over SSH

Ytalk is a free multi-user chat program which works similar to the UNIX talk program. The main advantage of ytalk is that it allows for multiple connections and can communicate with any arbitrary number of users simultaneously.

In this article, we will explain how to install and setup a private, encrypted and authenticated chat server with Ytalk over SSH for secure, password-less access into the chat server, for each participant.

Read Also: ssh-chat – Make Group/Private Chat with Other Linux Users Over SSH

Installing Ytalk and OpenSSH Server in Linux

Install Ytalk and OpenSSH Server using APT package manager as shown.

$ sudo apt-get update
$ sudo apt-get install ytalk openssh-server

Once installed, openbsd-inetd and sshd services should be auto-started by the installer. You can check if they are up and running as shown:

$ sudo systemctl status openbsd-inetd
$ sudo systemctl status sshd
$ sudo service openbsd-inetd status
$ sudo service sshd  status

Now create a user account called talkd and add it to the group tty on the system.

$ sudo useradd talkd
$ sudo usermod -a -G tty talkd

Now you need to configure inetd, open its main configuration file using your favorite text editor and edit it as explained below.

$ sudo vim /etc/inetd.conf

Scroll down to the lines:

talk dgram udp wait nobody.tty /usr/sbin/in.talkd in.talkd
ntalk dgram udp wait nobody.tty /usr/sbin/in.ntalkd in.ntalkd

and change them to look like this (replace the username “nobody” with “talkd“).

talk dgram udp4 wait talkd.tty /usr/sbin/in.talkd in.talkd
ntalk dgram udp4 wait talkd.tty /usr/sbin/in.ntalkd in.ntalkd
Configure inetd
Configure inetd

Then restart the openbsd-inetd for the recent changes to take effect, by running.

$ sudo systemctl restart openbsd-inetd
$ sudo service openbsd-inetd restart 

Create User Accounts and Configure SSH

Now its time to create user accounts for all the participants in the chat server with the adduser command.

$ sudo adduser tecmint
$ sudo adduser ravi

Afterwards, you need to configure password-less SSH login for all user accounts. The users need to create a private and public key combination on their local machines. Then the users need to send you the administrator, the contents of their public keys to add into a file known as authorized_keys, their home directory under /home/$USER/.ssh (for each user).

For example, to setup user tecmint after receiving the contents of his public key, do the following.

$ mkdir /home/tecmint/.ssh
$ chmod 600 /home/tecmint/.ssh
$ vim /home/tecmint/.ssh/authorized_keys  #copy and paste the contents of the public key in here
$ chmod 600 /home/tecmint/.ssh/authorized_keys

Testing the Secure Chat Server

At this stage, you now need to test if the chat server is working fine. Simply log into the server then run the ytalk command. For instance, if tecmint user wishes to chat with user ravi, all he can do is run.

$ ytalk ravi

Then user ravi after login, can run the following command to start chatting.

$ ytalk tecmint
Ytalk Chat Room on Linux
Ytalk Chat Room on Linux

That’s all! In this article, we have shown how to setup a private chat server with Ytalk over SSH. Share your comments via the feedback form below.

Tutorial Feedback...
Was this article helpful? If you don't find this article helpful or found some outdated info, issue or a typo, do post your valuable feedback or suggestions in the comments to help improve this article...

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

1 thought on “How to Setup Secure Private Chat Server with Ytalk over SSH”

Got something to say? Join the discussion.

Have a question or suggestion? Please leave a comment to start the discussion. Please keep in mind that all comments are moderated and your email address will NOT be published.