How to install Eternal Terminal for persistent SSH connections
If you have trouble with SSH connections breaking, Jack Wallen shows you how you can enjoy a bit more persistence with the help of Eternal Terminal.
If you’re an admin with Linux servers in your data center or cloud hosted account (such as AWS and Google Cloud), chances are pretty good you connect to those machines via SSH. Sometimes you need to remain connected for a good amount of time. You could be debugging code, working on containers or Kubernetes, or just about a thousand other reasons.
Thing is, sometimes those SSH connections get disconnected. This could occur because of a change in IP address or a host of reasons. When that happens, you have to re-connect. I’ve had experiences where SSH was constantly losing its connection, causing me to have to constantly reconnect.
That’s frustrating and time consuming. What can you do to avoid it?
One way around this problem is by using Eternal Terminal (ET), in place of SSH. Eternal Terminal does a great job of re-establishing a connection to a remote machine, without user intervention. That means once you’ve connected, you’ll stay connected until you break the connection manually.
I want to show you how to install and use Eternal Terminal. You can use this tool on Linux, macOS, and even Windows (using WSL).
SEE: Identity theft protection policy (TechRepublic Premium)
What you’ll need
To make use of Eternal Terminal, you’ll need at least two systems that support the software and you must use Eternal Terminal on both remote and local machines. I’ll be installing ET on Ubuntu Server 20.04 and Ubuntu Desktop 20.04. As far as Linux is concerned, it can be installed on Debian-based distributions and CentOS (via the epel-release repository).
How to install Eternal Terminal
On Ubuntu (both server and desktop), the installation of Eternal Terminal is quite simple. Log in to either the server or desktop and install the software that allows you to add new repositories from PPAs with the command:
sudo apt-get install -y software-properties-common
Next, add the necessary repository:
sudo add-apt-repository ppa:jgmath2000/et
Update apt and install Eternal Terminal with the commands:
sudo apt-get update sudo apt-get install et -y
Make sure to run through the above process on both the server and the desktop.
To install Eternal Terminal on CentOS 8 Stream, first install the epel-release with the command:
sudo dnf install epel-release -y
Install Eternal Terminal with the command:
sudo dnf install et -y
How to use Eternal Terminal
Using Eternal Terminal is exactly the same as using SSH, only you use the et command like so:
et SERVER
Where SERVER is the IP address or domain of the remote server.
Or:
et USER@SERVER
Where USER is the username on the remote server and SERVER is the IP address or domain of the remote server.
Eternal Terminal uses port 2022 by default–you’ll need to make sure that port is available.
As you use Eternal Terminal, you won’t find anything different than working with SSH, until a connection is broken, at which point ET will appear to be non-responsive. However, it will cache all keystrokes made at this point and, as soon as the connection is re-established, it will execute the cached commands.
Note: This only works if the connection is terminated on the remote side of things.
The caveat
Of course there’s a caveat. If your connection is broken by the client machine, and not the remote server, an orphaned session is created and you cannot reconnect to that orphaned session. In order to reconnect to the remote server, you’ll have to manually kill the orphan first. This is done with the command:
et -x USER@SERVER
Where USER is the username on the remote server and SERVER is the IP address or domain of the remote server.
And that’s the gist of using Eternal Terminal for persistent SSH connections to your remote Linux servers.
Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.