📘 Visual Posts About Contact
Explore 📋 Cheat Sheets ✏️ Practice 🎮 Games 🎬 Simulations 🃏 Flashcards 🎯 Interactive Layers 📖 Storytelling
💜 Support my site

Remote Access, SSH & RDP

Module 05: Interfacing Zero to Hero 2026 Updated

Real servers live inside locked data centers or cloud racks with no monitor, no mouse, and no keyboard. Learn how admins securely control Linux and Windows servers from thousands of miles away using SSH keys, Bastion jump hosts, RDP, and WinRM.

Start Module 05 ↓
ADMIN LAPTOP $ ssh prod Key: id_ed25519 PS> WinRM Your Desk SSH :22 🔒 Telnet :23 ✕ RDP :3389 🔒 LINUX SERVER Headless (No GUI) sshd listening :22 Encrypted CLI WINDOWS SERVER GUI + PowerShell RDP :3389 (NLA) WinRM :5985 / :5986

01 Why Servers Have No Monitor (SSH vs RDP vs Telnet)

Define: What is a Headless Server?

A headless server is a computer running in a data center or cloud provider (like AWS, Azure, or Hetzner) without a monitor, keyboard, or mouse attached. Instead of walking into a cold, noisy server room with a crash cart, you connect over the network using a remote access protocol.

Understand: The Postcard vs Sealed Armored Envelope Analogy

Imagine sending your bank PIN through the mail:

  • Telnet (Port 23) = Writing on a Postcard: Every word you type — including your username and password — travels across the internet in plain text. Anyone on the same Wi-Fi or router can read it effortlessly. Never use Telnet for admin login.
  • SSH (Port 22) = Sealed Armored Envelope (CLI): Everything is encrypted end-to-end before it leaves your laptop. You get a fast, lightweight text terminal to control Linux (and modern Windows) servers.
  • RDP (Port 3389) = Encrypted Live Video Stream (GUI): Remote Desktop Protocol streams the full graphical desktop of a Windows Server to your screen, sending your mouse clicks and keystrokes back inside an encrypted tunnel.

Know: Protocol & Port Comparison

Protocol Default Port Encryption Interface Type 2026 Verdict
SSH (Secure Shell) TCP 22 Strong (AES / ChaCha20) Command Line (CLI) Gold Standard (Linux & Cloud)
RDP (Remote Desktop) TCP/UDP 3389 TLS + NLA Full Graphical Desktop (GUI) Standard for Windows GUI (behind VPN/Bastion)
Telnet TCP 23 None (Plaintext!) Command Line (CLI) Obsolete & Dangerous (Never Expose)

🧠 Memory Trick: "22 for Two-way Shell, 23 is Plaintext Trouble, 3389 for Windows Screen"

SSH = 22 (the year-round standard for secure shells), Telnet = 23 (one number higher, zero encryption), and RDP = 3389 (Windows Remote Desktop).

When & Execute

Use SSH whenever you manage Linux servers, containers, or network gear, or when you want fast, low-bandwidth automation. Use RDP only when you genuinely need a Windows graphical wizard — and never expose Port 3389 directly to the open internet.

✓ Checkpoint: Can you...

  • Explain why production servers run "headless" without monitors or keyboards?
  • State the default ports for SSH (22), Telnet (23), and RDP (3389)?
  • Explain why Telnet is banned in modern server administration?

02 Password vs SSH Key Pairs (Padlock & Key Analogy)

Define: Asymmetric Key Authentication

An SSH Key Pair consists of two mathematically linked cryptographic files generated together: a Public Key (safe to share everywhere) and a Private Key (must never leave your device). Together, they replace guessable passwords with cryptographic proof.

Understand: The Padlock & Unique Key Analogy

Think of your Public Key (id_ed25519.pub) as an open padlock with your name on it. You can hand out copies of that padlock to 50 different servers and lock their front doors with it. Even if a hacker steals the padlock from a server, they cannot open the door — because only your Private Key (id_ed25519), sitting safely inside your laptop's ~/.ssh/ folder, can unlock it.

Why SSH Keys Beat Passwords (The Padlock & Key Model) OLD WAY: PASSWORDS Shared Secret Sent Over Network "Admin123!" (Human-chosen) 24/7 Bot Brute-Force Attacks Thousands of guesses/min on Port 22 Verdict: Weakest Link Reused or short passwords get cracked 2026 WAY: SSH KEY PAIR (Ed25519) YOUR LAPTOP 🔑 Private Key id_ed25519 Never leaves disk chmod 600 REMOTE SERVER 🔒 Public Padlock id_ed25519.pub Stored inside: authorized_keys Zero Secrets Sent Over the Wire! Server sends a random math puzzle → Laptop signs it with Private Key Server verifies with Public Key → Instant Login ✓

Know: Why Ed25519 Beats Legacy RSA

Older tutorials use ssh-keygen -t rsa -b 4096, which creates huge, slow keys. In 2026, Ed25519 is the modern default: it is shorter, faster, and cryptographically stronger against side-channel attacks.

Golden Rule of Key Hygiene: Always protect your private key with a passphrase when generating it, and ensure its file permissions are locked down (chmod 600 ~/.ssh/id_ed25519). OpenSSH will actually refuse to use a private key if other users on your laptop can read it!

03 Practical SSH Workflow & File Transfers

Define: The 4-Step Daily Admin Loop

Once you learn four core commands — ssh-keygen, ssh-copy-id, ~/.ssh/config, and scp/sftp — you can manage any Linux or cloud server in seconds without typing long IP addresses or passwords.

The 4-Step Practical SSH Workflow STEP 1: GENERATE Create Key Pair ssh-keygen -t ed25519 Creates private + .pub on laptop STEP 2: INSTALL Copy Public Key ssh-copy-id [email protected] Appends .pub to authorized_keys STEP 3: SHORTCUT Save Alias Config ~/.ssh/config Host prod-web Just type: ssh prod-web STEP 4: TRANSFER Move Files Safely scp app.zip prod-web:/tmp/ Or interactive: sftp prod-web $ ssh prod-web Connects using HostName, User, Port, and IdentityFile from ~/.ssh/config automatically!

Execute: Commands You Will Use Every Day

# 1. Generate a modern Ed25519 key pair with a comment label
ssh-keygen -t ed25519 -C "shekhar@work-laptop"

# 2. Copy your public key to the server (sets exact permissions automatically)
ssh-copy-id -i ~/.ssh/id_ed25519.pub [email protected]

# 3. Copy a local file to the server over SSH (scp)
scp ./nginx.conf prod-web:/tmp/nginx.conf

# 4. Open an interactive encrypted file browser (sftp)
sftp prod-web

Instead of memorizing ssh -i ~/.ssh/id_ed25519 -p 2222 [email protected], create a file at ~/.ssh/config (on Linux, macOS, and Windows OpenSSH):

Host prod-web
    HostName 203.0.113.50
    User admin
    Port 2222
    IdentityFile ~/.ssh/id_ed25519

Now typing ssh prod-web or scp file.txt prod-web:/var/www/ works instantly.

04 Jump Hosts (Bastion Servers) & SSH Hardening

Define: What is a Bastion / Jump Host?

A Bastion Host (also called a Jump Host) is a single, heavily hardened server sitting at the edge of your network. It is the only machine with a public IP address accepting SSH. Your actual database and application servers live inside a private subnet with no public IP, unreachable directly from the internet.

Understand: The Airport Security Checkpoint Analogy

You do not let passengers walk straight from the street onto the airplane runway. Everyone must pass through one guarded security checkpoint (the Bastion Host) first. Once verified, you are routed inside the secure terminal to your gate (private servers). With OpenSSH's ProxyJump (-J), this two-hop tunnel happens transparently in a single command — and your private key never gets copied onto the Bastion!

Bastion (Jump Host) Architecture & ProxyJump Tunnel ADMIN LAPTOP ssh -J bastion [email protected] Holds Private Key FIREWALL Hop 1 BASTION HOST Public IP: 203.0.113.10 Hardened sshd_config PermitRootLogin no PasswordAuth no Only entry point PRIVATE SUBNET (NO PUBLIC IP) APP SERVER 10.0.2.15 (Private) Accepts SSH from Bastion DATABASE SERVER 10.0.2.25 (Private) Zero Internet Exposure

Know & Execute: Essential SSH Hardening (/etc/ssh/sshd_config)

After copying your SSH key and confirming key login works, harden your Linux SSH server so brute-force bots hit a brick wall:

# Edit /etc/ssh/sshd_config (or a drop-in file in /etc/ssh/sshd_config.d/)
PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
MaxAuthTries 3

# Validate syntax BEFORE restarting (prevents locking yourself out!)
sudo sshd -t
sudo systemctl reload sshd
Lockout Prevention Rule: NEVER close your current SSH session while testing new sshd_config rules! Keep your existing terminal open, reload sshd, and test logging in from a second terminal window first.

📝 Practice Problem: Configuring a One-Command Jump Host

Given: Your company's Bastion Host is at 203.0.113.10 (user ops), and your private Database Server is at 10.0.2.25 (user dbadmin).

Find: How do you configure ~/.ssh/config so typing ssh prod-db tunnels through the Bastion automatically?

Show Solution

Define the Bastion host first, then reference it with ProxyJump:

Host bastion
    HostName 203.0.113.10
    User ops
    IdentityFile ~/.ssh/id_ed25519

Host prod-db
    HostName 10.0.2.25
    User dbadmin
    ProxyJump bastion
    IdentityFile ~/.ssh/id_ed25519

Now running ssh prod-db (or even ssh -J [email protected] [email protected]) creates an end-to-end encrypted tunnel without ever storing your private key on the Bastion.

05 Windows Server Remote Management (RDP, NLA & WinRM)

Define: RDP vs PowerShell Remoting (WinRM)

Windows Server supports two primary remote management paths: RDP (Remote Desktop Protocol, Port 3389) when you need a full graphical desktop, and WinRM (Windows Remote Management / PowerShell Remoting, Ports 5985/5986) when you want fast, scriptable command-line control across dozens of servers at once.

Understand: Network Level Authentication (NLA)

Without NLA (Network Level Authentication), an RDP server loads the entire Windows login screen before checking who you are — wasting memory and exposing the login UI to attackers. With NLA enabled, the server acts like a bouncer at the door: it verifies your credentials before creating a full graphical session.

Windows Server Remote Management: RDP (GUI) vs WinRM (CLI) RDP (Port 3389) — Graphical GUI 1. NLA Pre-Auth Shield Verifies user BEFORE loading Windows GUI 2. mstsc.exe Client Streams full desktop over TLS-encrypted channel Best For: GUI installers, MMC consoles, behind VPN/Bastion WinRM (5985 / 5986) — PowerShell 1. Interactive Shell Enter-PSSession -ComputerName SRV01 2. 1-to-Many Automation Invoke-Command -ComputerName SRV01,SRV02 Best For: Server Core, bulk patching, Ansible & scripts

Know & Execute: PowerShell Remoting Commands

Windows Server 2012 R2 through 2025 enables WinRM by default. If you need to enable it on a machine or run commands across multiple servers at once:

# Enable PowerShell Remoting on a Windows host
Enable-PSRemoting -Force

# Open an interactive remote PowerShell session (like SSH for Windows)
Enter-PSSession -ComputerName SRV-WEB01 -Credential (Get-Credential)

# Run a single command across 3 servers simultaneously
Invoke-Command -ComputerName SRV01, SRV02, SRV03 -ScriptBlock { Get-Service w32time }
Pro Tip (OpenSSH on Windows): Modern Windows Server also includes an official OpenSSH Server optional feature, allowing you to manage Windows servers with the exact same ssh and scp workflow you use on Linux!

🎯 Knowledge Check

Test your Remote Access & SSH knowledge — click an option for instant feedback. Score: 0 / 4

1. Why is Telnet (Port 23) never used for modern server administration?

It sends usernames, passwords, and commands in unencrypted plain text✅
It only works on Windows Graphical Desktops❌
It requires an Ed25519 key pair to start❌

2. In SSH key-pair authentication, which file is copied to the remote server's ~/.ssh/authorized_keys?

Your Private Key (id_ed25519)❌
Your Public Key (id_ed25519.pub)✅
The /etc/ssh/sshd_config file❌

3. What is the primary security purpose of a Bastion (Jump Host) server?

To disable SSH encryption so connections run faster❌
To serve as a single hardened gateway to private servers that have no public IP✅
To double the RAM of database servers❌

4. On Windows Server, what does Network Level Authentication (NLA) do for RDP (Port 3389)?

Requires the user to authenticate before a full graphical RDP session is created✅
Automatically converts RDP into a Linux Bash shell❌
Opens Telnet Port 23 for faster troubleshooting❌