Skip to content

casmacc/ssh-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ssh-chat

SSH-Chat server in a Docker container. See shazow's ssh-chat repo to learn more about SSH-Chat.

Demo

Type this command into your terminal:

$ ssh casmacc.net -p 9000

Building the ssh-chat image

$ docker build . -t casmacc/ssh-chat

Running the ssh-chat image

$ docker run -p 2022:2022 casmacc/ssh-chat

SSH Client

Type this command into your terminal:

$ ssh localhost -p 2022

With Docker Compose

It is possible to start many ssh-chat containers on a host, each listening on a separate port.

version: '3'

services:
  chat-project1:
    image: casmacc/ssh-chat
    volumes:
      - ./volumes/ssh1:/root/.ssh
    ports:
      - "9000:2022"
    restart: unless-stopped
  chat-project2:
    image: casmacc/ssh-chat
    volumes:
      - ./volumes/ssh2:/root/.ssh
    ports:
      - "9001:2022"
    restart: unless-stopped

Then:

TERMINAL1> ssh <server> -p 9000
TERMINAL2> ssh <server> -p 9000
TERMINAL3> ssh <server> -p 9001
TERMINAL4> ssh <server> -p 9001

SSH Keys

SSH Public Key for the container is in /root/.ssh/id_rsa. SSH keys are auto-generated by the startup script /root/ssh-chat.sh.

Note that if you destroy and regenerate the container, new SSH keys will be created, and your SSH clients will complain. To avoid this annoyance, either:

  1. do not destroy the container - use start/stop instead. - OR -
  2. save the .ssh directory in a volume, to make the keys persistent

For 2), here's the relevant snippet for your docker-compose file:

volumes:
  - ./volumes/ssh:/root/.ssh

About

SSH-Chat service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published