tmate.io and it's changing subdomains

80 views
Skip to first unread message

Samuel T

unread,
Feb 10, 2022, 3:59:54 AM2/10/22
to tmate.io
Hi all

I'm very sorry if this has been asked before already, but I didn't find a similar thread.

We're using tmate for a project where we deploy a printer and a raspi zero at the client location. To be able to reach the raspi, we configure tmate on each of them.

This works fine and I cannot describe how happy I am with this solution (@Nicolas, happy to send you a beer or two for your amazing work, if you provide me PayPal or something.):

Now the only thing which is a bit of a pitty for us is, that the subdomains keep changing (eg. from nyc1 to sfo2, vice versa etc).

1. Is this the normal behaviour, or did we mis-configure something?
2. Can I somehow configure it to always use the same domain?

I'm quite a noob when it comes to ssh - so please let me know if you need more details from our end. If that helps, I'll attach the script which we're running to setup the service on the raspis (yeah I know, probably also not the ideal solution - but hey, it works):

wget -P /home/x/ https://github.com/tmate-io/tmate/releases/download/2.4.0/tmate-2.4.0-static-linux-arm32v$CPU_VERSION.tar.xz
unxz /home/x/tmate-2.4.0-static-linux-arm32v$CPU_VERSION.tar.xz && tar -xf /home/x/tmate-2.4.0-static-linux-arm32v$CPU_VERSION.tar
sudo mv /home/x/tmate-2.4.0-static-linux-arm32v$CPU_VERSION/tmate /usr/local/bin/tmate
rm /home/x/tmate-2.4.0-static-linux-arm32v$CPU_VERSION.tar && rm -r /home/x/tmate-2.4.0-static-linux-arm32v$CPU_VERSION

echo "#### Setup tmate service"
echo "[Install]
WantedBy=multi-user.target

[Unit]
Description=Tmate-SSH
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
Restart=always
User=x
ExecStart=/usr/local/bin/tmate -F" | sudo tee -a /etc/systemd/system/tmate.service >/dev/null

echo "#### Setup tmate config"
echo "set tmate-api-key \"$TMATE_API_TOKEN\"
set tmate-authorized-keys \"~/.ssh/authorized_keys\"
set tmate-session-name \"$SESSION_NAME\"" > /home/x/.tmate.conf


echo "#### Start service"
sudo systemctl daemon-reload
sudo systemctl start tmate
sudo systemctl enable tmate
Reply all
Reply to author
Forward
0 new messages