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

[‘

n

ssh-chat is a cross-platform command line utility written in GoLang, which enables you to chat securely with a relatively small number of users over an ssh connection. It is specially designed to convert your SSH server into chat service. Once you launch it, you’ll get a chat prompt rather than a usual shell.

n

ssh-chat Features

n

    n

  1. Enables users to chat in a room via ssh.
  2. n

  3. Supports for private messaging between users.
  4. n

  5. Supports for color theme customization if supported by your ssh client.
  6. n

  7. It can examine any user’s public key fingerprint for identification reasons.
  8. n

  9. Enables users to set a nickname.
  10. n

  11. Support for whitelisting/blocking users as well as kicking users.
  12. n

  13. Supports for listing of all connected users.
  14. n

n

In this article, we will explain how to easily setup and use ssh-chat on Linux system to chat with other users on same server.

n

Requirements:

n

As I said, ssh-chat is written in GoLang, so if you don’t have GoLang installed on your system, follow this guide to install it.

n

    n

  1. How to Install GoLang (Go Programming Language) in Linux
  2. n

n

Installing ssh-chat in Linux Systems

n

Start by downloading the latest version of ssh-chat from its release page and extract the tar file and move into the package directory to run it as shown.

n

# cd Downloadsrn# wget -c https://github.com/shazow/ssh-chat/releases/download/v1.6/ssh-chat-linux_amd64.tgzrn# tar -xvf ssh-chat-linux_amd64.tgzrn# cd ssh-chat/rn# ./ssh-chatrn

n

SSH Chat Server
SSH Chat Server

n

Now your team members can connect to it using the ssh command, and start chatting in a straightforward chat room via a secure shell connection.

n

To demonstrate how it all works, we will use a ssh-chat server with IP: 192.168.56.10 and three users (root, tecmint and aaronkilik) connected over ssh to this the server as shown below.

n

Important: You’ll notice that all the three users are not entering any passwords while connecting to the server, this is because we have setup passwordless login for ssh connections. This is the recommended method of authentication for ssh connections in Linux.

n

$ ssh [emailxa0protected]rn$ ssh [emailxa0protected]rn$ ssh [emailxa0protected]rn

n

SSH User Logins without Passwords
SSH User Logins without Passwords

n

While connected to the server over ssh, all the above system users can join the chat room using ssh command like this (they must use the port which the chat server is listening on):

n

$ ssh localhost -p 2022rn

n

SSH Chat Room
SSH Chat Room

n

To view all chat prompt commands, a user should type the /help command.

n

[tecmint] /help rn

n

SSH Chat Help
SSH Chat Help

n

To send a private message, for instance; if user tecmint wants to send a secret message to aaronkilik, he/she would need to use the /msg command as follows.

n

[tecmint] /msg aaronkilik Am a hacker btw!rn[aaronkilik] /msg tecmint Oh, that's coolrn

n

You’ll notice that root doesn’t view the above messages as shown below.

n

SSH Chat User Private Messages
SSH Chat User Private Messages

n

To view a users information, use the /whois command like this.

n

[aaronkilik]/whois tecmintrn

n

To view all connected users in the chat room, use the /names command as follows.

n

[tecmint] /namesrn

n

There are several options to use with ssh-chat before starting the server. To set a message of the day file, use the --motd option like this.

n

$ ssh-chat --motd ~/motd_file  rn

n

To define a chat log file, use the --log option as below.

n

$ ssh-chat --motd ~/motd_file --log /var/log/ssh-chat.log         rn

n

You can optionally test with the developers server.

n

$ ssh chat.shazow.netrn

n

Finally, to view all server usage options, type:

n

$ssh-chat -hrnrnUsage:rn  ssh-chat [OPTIONS]rnrnApplication Options:rn  -v, --verbose    Show verbose logging.rn      --version    Print version and exit.rn  -i, --identity=  Private key to identify server with. (default: ~/.ssh/id_rsa)rn      --bind=      Host and port to listen on. (default: 0.0.0.0:2022)rn      --admin=     File of public keys who are admins.rn      --whitelist= Optional file of public keys who are allowed to connect.rn      --motd=      Optional Message of the Day file.rn      --log=       Write chat log to this file.rn      --pprof=     Enable pprof http server for profiling.rnrnHelp Options:rn  -h, --help       Show this help messagern

n

ssh-chat Github Repository: https://github.com/shazow/ssh-chat

n

Don’t forget to check out:

n

    n

  1. 5 Best Practices to Secure and Protect SSH Server
  2. n

  3. Configure “No Password SSH Keys Authentication” with PuTTY on Linux Servers
  4. n

  5. Protect SSH Logins with SSH & MOTD Banner Messages
  6. n

  7. How to Block SSH and FTP Access to Specific IP and Network Range in Linux
  8. n

n

ssh-chat is a really simple and easy-to-use secure chat service for Linux users. Do you have any thoughts to share? If yes, then use the feedback form below.

n

‘]