Catalog / Telnet Cheat Sheet
Telnet Cheat Sheet
A quick reference guide to using Telnet, covering basic commands, connection management, and security considerations. This cheat sheet provides a concise overview for network troubleshooting and remote access tasks.
Basic Telnet Commands
Connecting to a Host
|
Connect to the specified hostname using the default Telnet port (23). Example: |
|
Connect to the specified hostname on a specific port. Example: |
|
Opens a connection to the specified hostname and port from within the Telnet client. Example: |
Telnet Client Commands
|
Closes the current connection. |
|
Closes the current connection and exits the Telnet client. |
|
Displays the current status of the Telnet client, including connection information. |
|
Displays the Telnet client settings. |
|
Displays a list of available Telnet commands. |
Sending Special Characters
|
Sends special Telnet commands to the server. Common commands include: |
|
Aborts the output on the remote system. |
|
Interrupts the current process on the remote system. |
Advanced Telnet Usage
Negotiation Options
|
Sets various Telnet options. Common options include Example: |
|
Unsets a previously set Telnet option. Example: |
|
Toggles a boolean Telnet option between on and off. Example: |
Local Echo and Line Mode
|
Enables local echoing, so characters typed are displayed on your screen. |
|
Disables local echoing; useful if the server is already echoing characters. |
|
Sends carriage return and line feed characters. Some servers may require this. |
|
Sends only carriage return characters. |
Terminal Emulation
|
Sets the terminal type to a specific value (e.g., Example: |
|
Displays the currently set terminal type. |
Troubleshooting and Security
Common Issues
If you cannot connect, verify the hostname or IP address and port number are correct. Check if a firewall is blocking the connection on port 23 (or the specified port). |
If you see garbled output, try setting the terminal type ( |
If characters are not displaying correctly, ensure local echoing is enabled or disabled as needed ( |
Security Considerations
Warning: Telnet transmits data in plaintext, including usernames and passwords. This makes it vulnerable to eavesdropping and should generally be avoided on untrusted networks. Consider using SSH (Secure Shell) instead, which encrypts all transmitted data. |
If you must use Telnet, avoid transmitting sensitive information and only connect to trusted servers. |
Never use Telnet over public Wi-Fi or other untrusted networks. |
Alternatives to Telnet
SSH (Secure Shell) is the preferred alternative for secure remote access. It encrypts all transmitted data, protecting against eavesdropping. Command: |
For remote desktop access, consider using protocols like RDP (Remote Desktop Protocol) or VNC (Virtual Network Computing), which offer graphical interfaces and often support encryption. |
Practical Telnet Examples
Connecting to an SMTP Server
|
Connects to the SMTP server on |
|
Initiates an SMTP HELO handshake. Replace |
|
Closes the SMTP connection. |
Connecting to a Web Server
|
Connects to the web server on |
|
Sends a simple HTTP GET request for the root page. Press Enter twice after this line. |
Press Enter Twice |
After the |
Port Scanning with Telnet
Telnet can be used to quickly check if a port is open on a remote host. Try connecting to various ports using |
This is a rudimentary form of port scanning and should be used cautiously, respecting network policies and avoiding unauthorized scanning. |