Insights

How to Encrypt Telnet Traffic

Protect Telnet with compatible IPsec or TLS endpoints, require encryption, check path coverage, and test that plaintext access is blocked.

How to encrypt Telnet traffic: Vintage terminal with an enclosed network lead, with the doxxnet wordmark.
On this page

Ordinary Telnet doesn't encrypt your credentials or commands. If you need to keep using it, set up authenticated IPsec encryption between compatible endpoints, or use a Telnet-over-TLS implementation that both ends support. Require encryption, and don't allow a plaintext fallback.

Encryption only protects the path between its two endpoints. If a tunnel ends at a gateway, the rest of the connection to the Telnet device is still plaintext unless you protect it separately.

In short:

  • Best option: replace Telnet with SSH if the device supports it.
  • If you must keep Telnet: wrap it in IPsec or a supported TLS implementation.
  • Check where the encryption ends, and test that plaintext access is actually blocked.

Choose an encryption method your endpoints support

For everyday remote administration, replacing Telnet with SSH is usually the better choice when the device supports it. Keep Telnet inside a protected transport only when a legacy device or required terminal workflow can't use SSH.

MethodWhat you needWhat's protectedStill using Telnet?
IPsec between compatible hostsIPsec support, trusted peer authentication and matching policies on both hostsHost-to-host transport mode protects traffic between your computer and the Telnet serverYes
Encrypted tunnel ending at a gatewayCompatible encryption endpoints and a gateway that can reach the deviceYour computer to the gateway. Onward Telnet traffic stays plaintext unless protected separatelyYes
Supported Telnet-over-TLSCompatible terminal implementations and trusted certificate configurationBetween the two TLS endpointsYes, within the supported implementation
SSH replacementSSH support on the device and a compatible clientBetween the SSH client and serverNo

A regular Telnet client connecting to an unusual port doesn't automatically negotiate TLS. Both ends need real TLS support. Changing the port number isn't enough.

Map the protected path before configuring anything

Draw the whole route: your computer, any encryption gateway and the legacy Telnet device. With host-to-host IPsec, your computer and the Telnet server are the two encryption peers, so protection reaches all the way to the server. With a tunnel that ends at a gateway, protection stops at the gateway.

If a plaintext segment is unavoidable, put the device on a dedicated management or out-of-band network and limit access to the authorized gateway. That reduces exposure, but it doesn't encrypt the packets. Private addressing, segmentation and access controls are useful restrictions. They don't replace transport encryption.

Configure IPsec to require encryption for Telnet

IPsec policies can protect all traffic between the two peers, or just a specific service port. Choose service-specific protection if only Telnet needs it, or broader coverage if other traffic between the same hosts needs protecting too.

  1. Get authorization and keep a way back in. Record the existing configuration on both endpoints. Make sure you have console access or another verified recovery path before you change any policy.
  2. Confirm compatibility. Check that both endpoints support compatible IPsec modes, authentication methods and encryption settings.
  3. Choose the endpoint arrangement. Use host-to-host transport mode when your workstation and the Telnet server are the peers. A gateway setup only protects the path up to that gateway.
  4. Configure trusted peer authentication. Set up mutual authentication using a method both implementations support, and confirm each endpoint is set to authenticate the peer you intend.
  5. Match the traffic selectors. Write matching policies for the peer addresses, TCP and the actual Telnet port. For the default TCP port 23, the client policy matches the remote port and the server policy matches the local port. Include return traffic.
  6. Require encryption and integrity. Apply protection in both directions, and reject communication with peers that don't support IPsec. Don't enable an unsecured fallback.
  7. Activate both policies and check negotiation. Confirm that an encrypted IPsec security association is active between the intended peers before you type any Telnet credentials.

Configuration screens vary by implementation, and older policy interfaces aren't a universal procedure for current systems. If negotiation fails, stop and restore the recorded policy through your recovery path. Don't allow plaintext as a workaround.

Use TLS only with a compatible terminal implementation

Terminal access over TLS needs compatible behavior at both ends and trusted certificate configuration. Turn on the implementation's documented secure mode, then set up the certificates and trust settings it requires. Changing the destination port alone doesn't add encryption to ordinary Telnet.

IGEL Secure Terminal is one example. Its UMS-to-device connection uses TLS/SSL, and only a UMS whose certificate is stored on the device can start it. That workflow applies to that implementation, not to unrelated Telnet clients or appliances. If certificate validation fails, fix the trust or identity configuration using the implementation's documentation. Don't bypass validation.

Verify encryption and test that plaintext is blocked

A successful login shows access works. It doesn't show the path is protected. Combine connection-state checks, packet captures taken in the right place, and a controlled test of what happens without encryption.

  1. Inspect the negotiated protection. Look at the IPsec security associations or TLS connection status. Confirm the intended peers, active encryption, authentication status and, for IPsec, the expected traffic selectors.
  2. Capture on the network carrying encrypted traffic. With authorization, watch the segment between the encryption endpoints during a session that uses a disposable test account.
  3. Check the transport. You should see protected traffic, not readable Telnet credentials or commands, and the session should follow the route you mapped.
  4. Inspect the onward segment separately. If encryption ends at a gateway, check the gateway-to-device connection. An encrypted outer tunnel doesn't prove this segment is encrypted.
  5. Test rejection of plaintext. During controlled maintenance, with recovery access ready, confirm that a client without the required protection can't reach the Telnet service.
  6. Restore temporary test changes. Put test policies and access settings back as intended, then confirm that protected access still works.

A capture on the endpoint itself or on a loopback interface can legitimately show application data after decryption. On the other hand, unreadable traffic alone doesn't prove correct peer authentication or full path coverage.

If a capture on a segment that should be protected shows readable session content, or the plaintext-access test succeeds, stop using production credentials. Fix the routing and policy coverage, then repeat the checks.

Replace legacy Telnet when the device supports SSH

Transport encryption doesn't modernize vulnerable Telnet software, secure a compromised endpoint or protect plaintext past the end of a tunnel. When SSH is available, set up and verify authorized SSH access with console recovery ready, then disable Telnet once SSH works and has been tested.

If a device can't support SSH, document a time-limited exception, restrict management access and keep a retirement path. Protected transport is a way to contain the risk. It isn't a permanent fix for an unsupported device.

Some legacy hardware can also work with an SSH-accessible console manager. You connect securely to the manager and use the device's console from there. That replaces the network Telnet session with console access. It doesn't encrypt Telnet itself.

Ask an AI assistant

Share this article

Private Everywhere

Stop giving the internet everything

Keep your browsing, messages, files, and agents private.