Skip to content

🌐 Understanding Telnet and SSH

This tutorial covers the basics of Telnet and SSH, their packages, and their roles in network services. We'll explore the differences between client and server packages and provide common examples.

📑 Table of Contents

  1. 🔍 What is Telnet?
  2. 🔐 What is SSH?
  3. 📦 Types of Packages for Network Services
  4. Client Package
  5. Server Package
  6. 🔧 Common Commands and Examples

🔍 What is Telnet?

Telnet is a network protocol used to provide a command-line interface for communication with a remote device or server. It operates over TCP/IP and allows users to access remote systems as if they were local. However, Telnet transmits data, including passwords, in plain text, making it less secure compared to modern protocols.

Common Telnet Commands

  • Connect to a Remote Host:
telnet <hostname> <port>
  • Example:
telnet example.com 23
  • Exit Telnet Session:
  • Press Ctrl + ], then type quit.

🔐 What is SSH?

SSH (Secure Shell) is a protocol used to securely access and manage remote systems over a network. Unlike Telnet, SSH encrypts the data transmitted between the client and the server, providing a secure channel over an unsecured network.

Common SSH Commands

  • Connect to a Remote Host:
ssh <username>@<hostname>
  • Example:
ssh user@example.com
  • Copy Files Over SSH:
scp <local_file> <username>@<hostname>:<remote_path>
  • Example:
scp myfile.txt user@example.com:/home/user/
  • Exit SSH Session:
  • Type exit or press Ctrl + D.

📦 Types of Packages for Network Services

Client Package

Client packages are used to connect to remote services. For Telnet and SSH, these packages are installed on the client machine to initiate connections.

  • Telnet Client Package:

  • Debian/Ubuntu:

    sudo apt install telnet
    

  • CentOS/RHEL:

    sudo yum install telnet
    

  • SSH Client Package:

  • Debian/Ubuntu:
    sudo apt install openssh-client
    
  • CentOS/RHEL:
    sudo yum install openssh-clients
    

Server Package

Server packages are used to provide services that clients can connect to. These packages are installed on the server machine.

  • Telnet Server Package:

  • Debian/Ubuntu:

    sudo apt install telnetd
    

  • CentOS/RHEL:

    sudo yum install telnet-server
    

  • SSH Server Package:

  • Debian/Ubuntu:
    sudo apt install openssh-server
    
  • CentOS/RHEL:
    sudo yum install openssh-server
    

🔧 Common Commands and Examples

Telnet Examples

  • Check if Telnet Service is Running:
sudo systemctl status telnet
  • Configure Telnet Server:
  • Edit /etc/xinetd.d/telnet to enable or disable Telnet service.

SSH Examples

  • Start SSH Service:
sudo systemctl start ssh
  • Enable SSH to Start at Boot:
sudo systemctl enable ssh
  • Configure SSH Server:
  • Edit /etc/ssh/sshd_config to adjust settings like port, permit root login, etc.