Skip to content

TenderPro/dockerfile-tmate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Dockerfile Tmate-ssh-server

Short blurb about what your product does.

Build Status Downloads Stats

Tmate dockerfile for create docker image with own tmate-ssh-server

You can use your own generate keys. You can only allow connections using the keys entired in the authorized_keys

Details for use this service on tmate.io

Full-featured usage

This example uses a server with all the functions. Connection is availble only for those clients whose public keys are included in the authorized_keys (Knowledge of lines: [hash]@SERVER_FQDN is not enough for connect)

docker run --privileged --rm -i -p 22:22 \
     -v /etc/tmate/keys:/daemon-keys \  # server keys for auth server host (mount directory)
     -v /etc/tmate/authorized_keys:/authorized-keys \ # user keys for auth client connections (mount file)
     tmate-ssh-server \  # name of building docker image
     /bin/sh -c "/sbin/tmate-ssh-server -k /daemon-keys -a /authorized-keys -b 0.0.0.0 -p 22 -v -v -v -h SERVER_FQDN"

Variant to allow clients to connect only by line: [hash]@SERVER_FQDN

docker run --privileged --rm -i -p 22:22 \
     -v /etc/tmate/keys:/daemon-keys \  # server keys for auth server host (mount directory)
     tmate-ssh-server \  # name of building docker image
     /bin/sh -c "/sbin/tmate-ssh-server -k /daemon-keys -b 0.0.0.0 -p 22 -v -v -v -h SERVER_FQDN"

Featured of use

You need to deploy the server on a separate port (do not use the same port with ssh). Tmate-ssh-server independently implements the ssh protocol, openssh is not used.

Server keys

Versions on current year there is a bug, because of which you need to use only one server key - rsa. You can use host key from /etc/ssh or generate separate key.

Client tmate config

Typical configuration file for the client .tmate.conf.

set -g tmate-server-host "tmate.d4s.elatica.space"
set -g tmate-server-port 73
set -g tmate-server-rsa-fingerprint "be:6c:bc:4d:02:6b:f7:fe:5c:05:26:5c:c8:94:6d:2b"

Fingerprint must be on md5 format, for get fingerprint use command: ssh-keygen -E md5 -lf [sshkeyfile]

If the client key file does not use the default name (default: id_rsa), you must additionally use the option:

set -g tmate-identity "[path to you ssh key]"

Meta

Maxim Danilin – zan@whiteants.net

Distributed under the MIT license.

About

Dockerfile for tmate based alpine linux

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors