Tmux - Create persistent SSH sessions

Introduction to Tmux:
Tmux allows for two main features the regular Ubuntu/Linux terminal does not support. Firstly, it can serve as a terminal multiplexer, allowing you to tile different sessions/panes onto one terminal window. Secondly, it allows for a persistent session state, allowing you to resume a session from where you left off, or remotely ssh a session.

For Aion miners, this means you can remotely access your kernel, miner, and mining pool in the same customised layout you have on your main mining rig.

Installation:
Prerequisites : Ubuntu (as required for Aion as well)

check for updates: sudo apt-get update
install tmux: sudo apt-get install tmux
check for proper installation and versioning: tmux -V

Configuration:
Note that Tmux is based around sessions in terminal, there will be a green bar at the bottom of every Tmux session (you can customize theme in the .tmux.conf file, or find online themepacks)

Description Command
Start a new session with chosen session name tmux new -s {session name}
Start a new session with default naming tmux new
default session name will be indexed at 0
Get out of Tmux session exit
with multiple panes, “exit” will take you out of only the current pane
Detach from session ctrl+b d
detaching does not exit out of everything, it returns you to the original terminal
your session will not be closes and you can pick up from where you left off
List active sessions tmux ls
session name listed on the lefthand side
Return to a specific session tmux a -t {session number/name}
Return to the last created session tmux a -t #
Manage and customize panes (new pane created by splitting screen horizontally or vertically) crtl+b "
split horizontally ctrl+b %
split vertically ctrl+b {arrow key}
move to another pane ctrl+b : resize-pane {-U for up, -D for down, -L for left, -R for right} {number of lines to move by}
resize panes
Remotely SSH attach to a tmux session ssh <hostname> -t tmux a
7 Likes

This looks sweet, can’t wait to set it up. Thanks for sharing @Jason.