Candid photograph of a Linux server terminal with a soft olive-green glow against a dark slate background, conveying a calm technical atmosphere.

Step-by-step guides for system administrators — covering command-line basics, web server setup, and preparation material for technical interviews.

Browse Tutorials

Using screen and tmux terminal multiplexers

A terminal multiplexer creates a persistent virtual terminal for your shell and its child processes. Screen and tmux are the two common choices on Linux, letting administrators detach from an SSH session and reconnect without losing a deployment, log view, or interactive prompt.

This reliability matters for Australian administrators supporting systems from Sydney to Perth. A quick “arvo” handover may involve moving between office desktops, home connections, and remote servers, while daylight-saving changes can complicate timestamps and shift notes. Australian organisations also commonly manage mixed RHEL, CentOS Stream, and Fedora estates, making standard package availability an important consideration.

Why persistent sessions matter

A dropped VPN connection or closed laptop does not have to terminate a remote command. With a multiplexer, the client can disconnect while the shell, editor, build, or monitoring tool continues inside a server-side session. Reconnecting restores the same virtual terminal, including its working directory, scrollback, and running programs.

Testing should cover that behaviour rather than assume it. Teams can complement this with browser-level checks: Thucydides web tests can cover a web administration portal, while a separate terminal test confirms detachment and reconnection. A multiplexer protects against client disconnections, but it does not survive a server reboot.

Installing and preparing the tools

On RHEL, Fedora, and CentOS Stream, install both packages from the configured repositories:

sudo dnf install -y tmux screen

For older EL-based systems where dnf is unavailable, use the approved repository or vault configuration appropriate to the host:

sudo yum install -y tmux screen

Verify the installation and check that the terminal type supports the features required by remote applications:

tmux -V
screen --version
echo "$TERM"

Optional defaults can be placed in ~/.tmux.conf and ~/.screenrc. Useful tmux settings include mouse support and a larger history limit, while screen users can disable its startup banner and increase the default scrollback. Test colour output with tput colors because legacy hosts may not provide newer terminfo entries such as tmux-256color.

Managing tmux sessions and panes

Start a named session and use Ctrl-b as the default prefix key:

tmux new -s ops

Create additional windows and split the current window into panes:

tmux new-window -t ops -n logs
tmux split-window -t ops -h
tmux split-window -t ops -v

The -h option places panes side by side, while -v stacks them. Within tmux, Ctrl-b followed by % creates another vertical division, and Ctrl-b followed by " creates a horizontal one. Arrow keys move between panes, Ctrl-b c opens a window, and Ctrl-b , renames the current window.

Detach with Ctrl-b followed by d. Afterwards, list sessions, reconnect to one, or remove it deliberately:

tmux ls
tmux attach -t ops
tmux kill-session -t ops

Because tmux uses a background server, several clients can attach to the same session. That is useful when a Sydney administrator and a Brisbane colleague need to observe the same deployment, although both should agree before typing into shared panes.

Managing screen sessions

Screen follows a simpler model. Begin a named session, then detach with Ctrl-a followed by d:

screen -S ops

List existing sessions and restore one after reconnecting:

screen -ls
screen -r ops

Window controls use the same Ctrl-a prefix: Ctrl-a c creates a window, Ctrl-a n moves to the next window, and Ctrl-a p returns to the previous one. Ctrl-a S splits the current region. Copy mode begins with Ctrl-a [, allowing the mouse, arrow keys, or search to select earlier output.

Screen remains common on older servers because it is compact and widely available. If several administrators use the same account, individual screen sessions remain separate, making accidental shared input less likely than with an attached tmux server session.

Choosing between screen and tmux

Screen is a strong choice for lightweight administration, legacy hosts, and users who only require detach, reattach, and basic window management. Tmux provides richer pane layouts, copy mode, configurable key bindings, session listing, and straightforward command-driven automation. Its server model also supports multiple attached clients and safer transfer of a session between terminals.

Neither tool replaces proper logging, process supervision, or configuration management. Both preserve active terminal state, but a crashed application, terminated shell, or rebooted host will still end that state. Review the Linux interview questions collection for additional practice on persistent sessions, SSH, process handling, and related administration concepts.

Building a resilient remote workflow

SSH keepalives reduce silent connection failures, but they do not replace a multiplexer. A workstation configuration can use an Australian host’s bastion or jump path while maintaining the connection:

Host app-prod
    HostName app-prod.example.net
    User admin
    ServerAliveInterval 30
    ServerAliveCountMax 3

Test the workflow with a harmless long-running command, such as sleep 600, inside a named tmux session. Detach, interrupt the network briefly, reconnect, and confirm that the process and window remain intact. Repeat the exercise with screen on hosts where it is the established standard, and document the correct reconnection command for each.

A concrete first checkpoint is to open tmux new -s admin-check, start the command you currently need to preserve, detach with Ctrl-b d, reconnect through SSH, and verify recovery with tmux attach -t admin-check.