Remote terminal access with tmate

From lechacal
Jump to navigation Jump to search

tmate

tmate is a great tool to remotely let access to someone else in a terminal. This is particularly useful for third party support.

To allow access on a terminal on the raspberrypi follow these steps below.

First install tmate

sudo apt-get install tmate

Then generate keys. Press return when prompted.

ssh-keygen -t rsa -b 4096

The prompt below will appear:

Enter file in which to save the key (/home/pie/.ssh/id_rsa):

Just press enter without giving any input.
Same thing when it asks for a password twice. Just press enter. (or do enter a password if you wish)

Run with the command below

tmate

The following text will appear in the terminal

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  or <ctrl-c> to continue
---------------------------------------------------------------------
Connecting to ssh.tmate.io...
Note: clear your terminal before sharing readonly access
web session read only: https://tmate.io/t/ro-VgDuCGGwrGrwm6u2jnzsQX5Pt
ssh session read only: ssh ro-VgDuCGGwrGrwm6u2jnzsQX5Pt@lon1.tmate.io
web session: https://tmate.io/t/E6etPMv44BeJJNBAWdRW37QVd
ssh session: ssh E6etPMv44BeJJNBAWdRW37QVd@lon1.tmate.io

Copy and paste this content to whom you wish offering access.