We love Tmate and we bet you will!
Sure, we all know about TeamViewer, VNC, and other remote desktop products we used hundred times to help our parents or friends through a shared screen. But nothing compares nor prepares you for this in terms of simplicity and seamlessness, especially if Terminals are part of your daily job.
Total ubiquity, full encryption and of course completely free. Those were the features of Tmate, an opensource fork of Tmux (local terminal multiplexer) which lets you attach a terminal session from across the world. No more sharing all your desktop’s screen and worrying about your sensitive data or browser tabs you forgot to close.
That’s where I thought this little discovery deserved a post on its own.
How it works
Once installed in your machine you’d run tmate command to establish a secure SSH connection with tmate.io’s public server that’ll return random SSH and HTML connection strings for your session. Your friend will then paste the connection string (or URL) to attach your terminal session and instantly start interacting with it. This is particularly helpful when using different keyboards. To add more to this awesomeness, remote clients don’t even need Linux as they can pair through a web browser. You can learn more about the architecture from the author’s paper, or by checking the below diagram I managed to draw from reading his publication ;).
![]() |
Tmate Architecture |
Connection string: The 25 character long random id generated for the session is called token.
# curl -L https://github.com/tmate-io/tmate/releases/download/2.4.0/tmate-2.4.0-static-linux-amd64.tar.xz | tar Jxvf - ; mv tmate*/tmate /usr/bin
2. Run “tmate” command.
tmate
> Copy the content and hit q to clear the screen.
Tip: if you wish to use tmate only for remote access, run: tmate -F [0/0]To see the following messages again, run in a tmate session:
tmate show-messages Press <q> or <ctrl-c> to continue --------------------------------------------------------------------- Note: clear your terminal before sharing readonly access web session read only: https://tmate.io/t/ro-Kjh2VHM8xpAEEUjnNxz4aavMb ssh session read only: ssh ro-Kjh2VHM8xpAEEUjnNxz4aavMb@nyc1.tmate.io web session: https://tmate.io/t/ytNAPhtmczmkbPs2aAvWpEK5C ssh session: ssh ytNAPhtmczmkbPs2aAvWpEK5C@nyc1.tmate.io
and voila. You are now connected to the host session without any authentication setup.
> Let’s run a command.
tmate show-messages
tmate -k API_KEY -n session-name
exit
Install your own server
by deploying the docker images listed below: (more details at tmate.io)
- tmate-ssh-server (ssh access)
- tmate-websocket (html and named sessions)
- tmate-master (requires Postgres database)
- tmate-kube (kubernetes to create and manage above containers)
Once installed your local machines you want to share sessions from should include the below attributes in the ~/.tmate.conf file
set tmate-server-host Mytmatehost
set tmate-server-port 2200
set -g tmate-server-rsa-fingerprint "SHA256:MyTmateFngerprint"
set -g tmate-server-ed25519-fingerprint"SHA256:tmateEdDSAFingerprint”
WHAT’S NEXT
I keep enjoying tmate as I was just live fixing a kvm terraform issue I was stuck on, yesterday, with the help of a developer from Sao Paulo (Brazil). Such a cool way to learn and discover the world ;). Feel free to talk about it with your colleagues.
#Dobrigado :)