Allowing direct access to the Raspberry Pi desktop is helpful, especially when using different SSH enabling tools like PuTTY and VNC viewer. However, these two only allow Raspberry Pi access within the firewall. So sharing your Raspberry Pi terminal with a trusted person won’t be possible from behind the firewall using these tools and to cope with this issue, tmate is introduced.
tmate is an application that lets you share your Raspberry Pi terminal with anyone using the special key. In addition, your Raspberry Pi terminal can be viewed from anywhere via the tmate secure servers, making it ideal for Raspberry Pi users to discuss their problems with their friends.
How to share Raspberry Pi terminal through tmate
This guide will show you how you can use the tmate application to access the Raspberry Pi terminal from a remote location. To ensure the successful installation of tmate, you will need to do the following steps.
Step 1: First, go to the Raspberry Pi terminal and execute the below mentioned commands to update the packages on your Raspberry Pi device.
$ sudo apt upgrade
Step 2: Once you update the packages, it’s now time to run the following command on your Raspberry Pi terminal to install the tmate.
Step 3: Before running tmate, you will first need to generate SSH keys so that it will allow the tmate to use these keys to encrypt the connection. To generate the keys, we use the RSA encryption method with a size of 4096 bits and the following command will be used for this purpose.
Press the Enter button to save the key in the desired folder.
Now, provide the passphrase to complete the process.
Step 4: Now, run the tmate using the following command.
Enter the passphrase you have set during the tmate setup and press Enter.
It will connect you to the SSH session.
Step 5: Now, to find the session ID, use the following command.
From the above command, you will see the list of read only and as well as writeable web and SSH sessions.
If you want to share the terminal with your friend, you will need to pick a writeable web session which is highlighted below in the image.
However, before that, you will need to run the SSH session right below the web session key.
Enter “yes” to continue connecting the ssh session.
Once the above steps are done, you have to share the websession key shown above with the person you want to share your terminal with.
Conclusion
The tmate is an excellent little utility designed for the Raspberry Pi users to share their device terminal with the trusted people. It also opens up the opportunity for the users to share their Raspberry Pi related problems with their friends with the built-in tmate servers. The above steps will guide you in setting up tmate on your Raspberry Pi and once it’s completed, you can then share the web session, which includes a special key to other people in allowing them to use your Raspberry Pi terminal.