Loading...

Lab 62: SSH and Telnet - Remote Access

Validate remote access to both modern and legacy hosts by establishing an SSH session with host key verification and then performing a basic Telnet connectivity test. Use clean exits to terminate each session and preserve predictable operator behavior during troubleshooting.

network security troubleshooting

Scenario

You are working remotely and need to validate access to two systems: a modern server reached via ssh and a legacy endpoint that still exposes a Telnet service on port 23. Your goal is to confirm that you can reach the remote host, accept the SSH host key fingerprint prompt correctly, exit cleanly, and then perform a Telnet connection test to verify basic service reachability.

Operator context

SSH is the standard for secure remote administration. Telnet is insecure and should not be used for sensitive work, but you may still encounter it in legacy environments. In those cases, the most common use is simple reachability testing or confirming that a TCP port is open.

Objective

  • Establish an SSH session to 192.168.0.42 as user admin and accept the host key prompt.
  • Exit the SSH session cleanly.
  • Connect to the same host over Telnet on port 23.
  • Terminate the Telnet session cleanly.

What You’ll Practice

  • Establishing an SSH connection using the user@host syntax.
  • Handling first-connection SSH host key fingerprint prompts and building predictable operator habits.
  • Using Telnet as a basic legacy connectivity check (service reachable vs not reachable).
  • Clean session termination for both SSH and Telnet.

Walkthrough

Step 1 : Connect to the remote host using SSH.
Command
ssh admin@192.168.0.42

This starts a secure remote login. On first connection, SSH prompts to confirm the host key fingerprint. Accepting the fingerprint adds the host to your known_hosts file and prevents silent man-in-the-middle changes from going unnoticed later.

The authenticity of host '192.168.0.42' can't be established.
ECDSA key fingerprint is SHA256:examplekey.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
yes

Warning: Permanently added '192.168.0.42' (ECDSA) to the list of known hosts.
admin@192.168.0.42's password:
Welcome to remote server.
Step 2 : Exit the SSH session.
Command
exit

Always exit interactive sessions cleanly. This keeps your operator workflow predictable and prevents “ghost sessions” when you are triaging multiple systems.

Connection closed.
Step 3 : Connect to a legacy service using Telnet on port 23.
Command
telnet 192.168.0.42 23

Telnet is plaintext and not suitable for secure administration. In modern workflows, it is most commonly used to confirm that a TCP port is reachable and a service is listening.

Trying 192.168.0.42...
Connected to 192.168.0.42.
Escape character is '^]'.
Welcome to Legacy Server.
Step 4 : Close the Telnet session.
Command
quit

Terminate the Telnet session cleanly to ensure the remote side closes the connection and returns you to your local shell without ambiguity.

Connection closed by foreign host.

Reference

  • ssh <user>@<host> : Connects to a remote system securely using the SSH protocol.
    • First-time connections prompt for host key verification before the host is added to ~/.ssh/known_hosts.
  • exit : Ends the current interactive shell session (used here to terminate SSH cleanly).
  • telnet <host> <port> : Opens a plaintext TCP session to a host/port (commonly used for legacy access or basic reachability testing).
    • Telnet is not encrypted. Avoid using it for sensitive credentials or administration.
  • quit : Closes the current Telnet session and returns to the local shell.