Raspberry Pi4, tmux, and ssh for the win

In 2020 I used the RPi4 (2GB model) as my daily driver for about two months. The 2GB model was a rock star for my minimal computing. It booted while automatically connecting to my VPN provider . The real heart of my computing experience came from tmux and ssh. These two together are quite the powerhouse.

The Amazing Tmux

If you are unfamiliar with tmux, it is a terminal multiplexer used primarily to create multiple windows, panes, and sessions within a single terminal display on a computer. For the uninitiated, the terminal is that black screen with all the text that those computer geeks use. However, once one learns how to use a terminal session for even the simplest of tasks one must ask, ‘what else can I do in this thing’. Enter tmux.

Every day I used my terminal to download files for offline use, transfer those files to other machines on my network, surf the web, write articles and essays, play games, read and write email, and a little light bash scripting, server administration, and even checking the weather. I can do all of these activities within the same screen or sometimes multiple windows. Tmux allows focus of individual panes by pressing ctrl+b+z. Although a single terminal window can have 4, 6, or eight panes, one can navigate to and the apply focus to a single pane thus making it full screen.
New windows can be established by pressing ctrl+b+c. Windows can be renamed by pressing ctrl+b+shift+:, and then typing rename-window [new window name], without the brackets. Multiple windows can be leveraged for different purposes.

24/7 Sessions

When I am done with my time in the terminal I do not have to kill the session. I can simply “detach” from the session and it will continue to run in the background. Later, I can reconnect where I left off in the same windows, panes, and sessions if there are multiple sessions. Considering the RPi is truly power sipping there is no reason not to leave it running 24/7 with a tmux session as well. Because the session stays up and running, remote tasks can continue process without needing to sending them to the background. It is truly a beautiful thing.

SSH in the Mix

Using ssh allows me to connect to my tmux session from a remote computer or network/internet enabled device. This has made my redeemed my Chromebook a valuable tool . Remote computing via SSH is nothing new but it is still very awesome. The same could be done into a virtual private server (VPS), thus keeping a remote desktop available in the cloud for a few dollars a month. While that does have its advantages I find it just as easy to roll my own VPN and connect back to my Pi and thus network remotely from anywhere and from almost anything like a Chromebook or mobile device with a terminal emulator and Internet access. I’ve been successful with my mobile phone, terminal emulator, and bluetooth connected keyboard.

Conclusion

The remote nature of SSH also means that files can stay on the Pi (and various pre-mapped network locations) and not need to be synced with many devices. If you are using the terminal and have not yet discovered tmux please do yourself a favor and get it!

sudo apt install tmux