The Deska blog
Alternatives to Plain SSH for Persistent Sessions
Explore the best alternatives to plain SSH for persistent sessions, from tmux and Mosh to modern workspace-based tools like Deska.
· 10 min read
Standard Secure Shell (SSH) is the backbone of remote server administration, yet it often falls short when engineers require stable, long-running environments. Relying on a basic connection means that a single network hiccup or a laptop lid closure can terminate a critical process. For developers seeking alternatives to plain SSH for persistent sessions, the landscape has evolved from simple command line multiplexers to comprehensive local-first environments that bridge the gap between local and remote states.
The Problem with Plain SSH Sessions
A standard SSH session is tied directly to the lifecycle of the TCP connection. When the connection drops, the shell process on the remote host receives a hangup signal (SIGHUP), which typically terminates the shell and any child processes running within it. This behavior is problematic for several reasons.
Long running tasks such as database migrations, large builds, or data processing jobs can fail halfway through if the internet fluctuates. Furthermore, plain SSH provides no way to resume a session from a different device. If you start a task at your desk, you cannot easily pick up the exact same terminal state on a mobile device without specialized software.
Traditional Terminal Multiplexers
Terminal multiplexers are the classic solution to session persistence. These tools sit between the user and the shell, keeping the shell process alive even when the user disconnects.
tmux (Terminal Multiplexer)
The most popular choice today is tmux. It allows users to create multiple windows and panes within a single terminal window. Because the tmux server runs independently of the SSH session, you can detach from a session and reattach later.
- Stability: The server process is extremely lightweight and rarely crashes.
- Flexibility: You can split your screen into multiple areas to monitor logs while editing files.
- Scriptability: Users can create complex layouts that load automatically upon startup.
GNU Screen
As the predecessor to tmux, GNU Screen is still widely available on almost every Unix-like system. While it lacks some of the more modern layout features and the refined status bar of tmux, it remains a reliable fallback for basic session persistence. It is often the only tool available on legacy enterprise systems where installing new packages is restricted.
Enhancing Connection Stability with Mosh
While multiplexers keep the process alive on the server, they do not help with the connectivity itself. This is where the Mobile Shell (Mosh) enters the picture. Mosh is specifically designed to handle roaming and intermittent connectivity.
Mosh uses the State Synchronization Protocol (SSP) over UDP. Unlike SSH, which requires a constant TCP stream, Mosh predicts user keystrokes locally to provide instant feedback and only synchronizes the state of the screen. When your IP address changes or your laptop wakes from sleep, Mosh reconnects automatically without user intervention.
| Feature | Plain SSH | tmux + SSH | Mosh |
|---|---|---|---|
| Persistence | No | Yes | Partial |
| Local Echo | No | No | Yes |
| Roaming | No | No | Yes |
| Port Config | 22 (TCP) | 22 (TCP) | 60000+ (UDP) |
Modern Persistent Workspaces
A new category of tools has emerged that treats the entire development environment, not just the terminal, as a persistent entity. These tools often combine terminal management with file editing and AI integration.
The Deska Workspace Model
Deska takes a different approach by providing a local-first desktop application that manages sessions through an infinite canvas. Instead of just maintaining a terminal connection, Deska allows you to arrange terminals, code editors, and browsers in a visual space.
This setup is particularly useful for persistent workflows because the state is managed within your local machine. When you use the canvas, your panels remain exactly where you left them. If you are running long processes via the terminal panels, they continue to run locally while you interact with other tools.
Integrated AI and Sessions
Modern persistence is increasingly about context. Tools like Deska allow you to run coding agents such as Claude Code or OpenCode side by side with your sessions. These agents can monitor the output of a persistent terminal and provide feedback. Because these are local-first agents using your own API keys, the context of your persistent session remains private and secure.
Remote Access Without Exposed Ports
One of the biggest hurdles in maintaining persistent sessions across locations is firewall management. Traditional SSH requires port forwarding or a VPN.
Deska solves this through its mobile app functionality. By using a secure relay, your mobile device and your primary workstation pair directly. This allows you to monitor long-running sessions or continue work from your phone without exposing any ports to the public internet. This represents a significant shift from the traditional SSH model, moving toward a "workspace as a service" that lives on your own hardware.
Strategies for Session Management
- Use a multiplexer like tmux for server-side persistence to ensure processes don't die on disconnect.
- Layer Mosh over your connection if you frequently move between Wi-Fi networks or use cellular data.
- Adopt a canvas-based workspace for complex projects that require multiple panels and persistent visual context.
- Integrate AI agents into your workflow to automate the monitoring of your persistent tasks.
Frequently Asked Questions
How do I keep a process running after closing SSH?
The most common way is to use a multiplexer like tmux. Start a session with the tmux command, run your process, and then press Ctrl+b followed by d to detach. You can later resume with tmux attach. Alternatively, you can use the nohup command for simple tasks, though it does not allow for interactive reattachment.
What is the difference between tmux and Mosh?
They solve different problems. tmux keeps your programs running on the remote server after you disconnect. Mosh makes the connection itself more resilient to network changes and lag. Most developers get the best results by using Mosh to connect to a server and then running tmux inside that connection.
Is there a free way to manage remote sessions on mobile?
Yes, you can use various SSH clients, but they often struggle with connection drops. Deska offers a mobile app that pairs with your desktop to provide a secure way to monitor and manage your local sessions remotely without the need for complex server configurations or port forwarding.
Get Started with Persistent Workspaces
If you are tired of losing your terminal state or need a more visual way to manage your development environment, Deska offers a modern solution. By combining a local-first architecture with an expansive canvas, it provides a level of persistence that standard command line tools cannot match.
You can download the free app for Mac, Windows, and Linux to start building your persistent workspace today.