DEVOPS SSH & NETWORKING PRACTICAL LAB

Source: Dev.to | Dec 28, 2025 (UTC)

🧩 MODULE 1 — NETWORK FOUNDATION (WHY SSH WORKS)

🔹 Lecture Topics Covered

  • TCP vs UDP
  • Port scanning (Nmap)
  • NAT & Port Forwarding
  • Home vs Cloud networking
  • Why SSH ports matter

🧪 LAB 1 — Understanding Ports & Services (Nmap)

🎯 Goal

Understand what ports are, why SSH uses ports, and how attackers find servers.

🧠 Concept (Beginner Explanation)

A port is like a door on a server.
SSH uses port 22 by default.

Attackers scan the internet to find open doors.

🧪 Exercise

  1. Install nmap:

sudo apt install nmap -y

Enter fullscreen mode

Exit fullscreen mode

  1. Scan localhost:

nmap localhost

Enter fullscreen mode

Exit fullscreen mode

  1. Scan SSH explicitly:

nmap -p 22 localhost

Enter fullscreen mode

Exit fullscreen mode

  1. Run SYN scan (root required):

sudo nmap -sS localhost

Enter fullscreen mode

Exit fullscreen mode

🧠 What You Learn

🧑‍💼 DevOps Real-World Use

Before exposing a server, DevOps engineers scan their own infrastructure to ensure only expected ports are open.

🧪 LAB 2 — NAT & Port Forwarding (Mental Model)

🎯 Goal

Understand why SSH sometimes works locally but not from outside.

🧠 Concept

🧪 Exercise (Observation)

  1. Find local IP:

ip a

Enter fullscreen mode

Exit fullscreen mode

  1. Find gateway:

ip route

Enter fullscreen mode

Exit fullscreen mode

  1. Understand:

🧠 What You Learn

🧩 MODULE 2 — SSH FUNDAMENTALS

🔹 Lecture Topics Covered

🧪 LAB 3 — Install & Start SSH Server

🎯 Goal

Turn a machine into a real server.

🧠 Concept

SSH server = remote control service

🧪 Exercise

Ubuntu:

sudo apt update sudo apt install openssh-server -y sudo systemctl status ssh

Enter fullscreen mode

Exit fullscreen mode

CentOS:

sudo dnf install openssh-server -y sudo systemctl enable sshd --now

Enter fullscreen mode

Exit fullscreen mode

🧠 What You Learn

🧑‍💼 DevOps Reality

Every cloud VM you manage relies on SSH.

🧪 LAB 4 — SSH Connection Basics

🎯 Goal

Log into a server remotely.

🧪 Exercise

ssh user@server-ip

Enter fullscreen mode

Exit fullscreen mode

Test:

whoami hostname pwd

Enter fullscreen mode

Exit fullscreen mode

🧠 What You Learn

🧩 MODULE 3 — SSH SECURITY HARDENING (CORE DEVOPS SKILL)

🔹 Lecture Topics Covered

🧪 LAB 5 — Change SSH Port (22 → 2222)

🎯 Goal

Reduce attack surface.

🧪 Exercise

sudo nano /etc/ssh/sshd_config

Enter fullscreen mode

Exit fullscreen mode

Change:

Port 2222

Enter fullscreen mode

Exit fullscreen mode

Test:

sudo sshd -t sudo systemctl restart sshd

Enter fullscreen mode

Exit fullscreen mode

Connect:

ssh -p 2222 user@server

Enter fullscreen mode

Exit fullscreen mode

🧠 What You Learn

🧑‍💼 DevOps Reality

Every production SSH server does this.

🧪 LAB 6 — Disable Root Login

🎯 Goal

Prevent instant full compromise.

🧪 Exercise

PermitRootLogin no

Enter fullscreen mode

Exit fullscreen mode

Restart SSH.

Test:

ssh root@server

Enter fullscreen mode

Exit fullscreen mode

🧠 What You Learn

🧪 LAB 7 — AllowUsers Whitelisting

🎯 Goal

Explicitly control access.

🧪 Exercise

AllowUsers devuser

Enter fullscreen mode

Exit fullscreen mode

Test login failure for others.

🧠 What You Learn

🧩 MODULE 4 — DO NOT LOCK YOURSELF OUT

🔹 Lecture Topics Covered

🧪 LAB 8 — Two-Session Safety Practice

🎯 Goal

Never brick a production server.

🧪 Exercise

  1. Open two SSH terminals
  2. Stop SSH:

sudo systemctl stop sshd

Enter fullscreen mode

Exit fullscreen mode

  1. Observe:
  1. Restore:

sudo systemctl start sshd

Enter fullscreen mode

Exit fullscreen mode

🧠 What You Learn

🧩 MODULE 5 — SSH KEYS (ENTERPRISE AUTH)

🔹 Lecture Topics Covered

🧪 LAB 9 — SSH Key Authentication

🎯 Goal

Replace passwords with cryptography.

🧪 Exercise

ssh-keygen -t rsa -b 4096 ssh-copy-id -p 2222 user@server ssh -p 2222 user@server

Enter fullscreen mode

Exit fullscreen mode

🧠 What You Learn

🧩 MODULE 6 — DISABLE PASSWORD LOGIN

🔹 Lecture Topics Covered

🧪 LAB 10 — Enforce Key-Only SSH

🎯 Goal

Eliminate brute-force attacks.

🧪 Exercise

PasswordAuthentication no

Enter fullscreen mode

Exit fullscreen mode

Restart SSH.

Test:

ssh user@server

Enter fullscreen mode

Exit fullscreen mode

From another user → should fail.

🧠 What You Learn

🧩 MODULE 7 — KEEP SSH ALIVE

🔹 Lecture Topics Covered

🧪 LAB 11 — Prevent Connection Drops

🎯 Goal

Survive long deployments.

🧪 Exercise

nano ~/.ssh/config

Enter fullscreen mode

Exit fullscreen mode

Host * ServerAliveInterval 60 ServerAliveCountMax 3

Enter fullscreen mode

Exit fullscreen mode

🧠 What You Learn

🧩 MODULE 8 — FINGERPRINTS & MITM PROTECTION

🔹 Lecture Topics Covered

🧪 LAB 12 — Fingerprint Verification

🎯 Goal

Detect impostor servers.

🧪 Exercise

Client:

cat ~/.ssh/known_hosts

Enter fullscreen mode

Exit fullscreen mode

Server:

ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub

Enter fullscreen mode

Exit fullscreen mode

Compare hashes.

🧠 What You Learn

🧩 MODULE 9 — FILE TRANSFER (SFTP / SCP)

🔹 Lecture Topics Covered

🧪 LAB 13 — SCP & SFTP

🎯 Goal

Move data securely.

scp -P 2222 file.txt user@server:/home/user/ scp -P 2222 user@server:/home/user/file.txt .

Enter fullscreen mode

Exit fullscreen mode

GUI:

🧠 What You Learn

🧩 MODULE 10 — SCREEN (PRODUCTION SURVIVAL TOOL)

🔹 Lecture Topics Covered

🧪 LAB 14 — Screen Mastery

🎯 Goal

Survive disconnects & collaborate.

screen Ctrl+A Ctrl+D screen -x exit

Enter fullscreen mode

Exit fullscreen mode

🧠 What You Learn

🏁 FINAL CAPSTONE PROJECT

🎯 Scenario

You are the only DevOps engineer managing a production server.

You must:

  1. Harden SSH
  2. Use key auth only
  3. Prevent lockout
  4. Enable file transfer
  5. Keep sessions alive
  6. Share terminal with teammate

🎓 OUTCOME

After completing this:

If you want, next I can:

Just tell me what you want next.

Audience: Absolute beginners
Outcome: Production-ready DevOps engineer mindset
Environment: Ubuntu / CentOS / Cloud / VM
Style: Real-world, mistakes included, recovery included

🧩 MODULE 1 — NETWORK FOUNDATION (WHY SSH WORKS)

🔹 Lecture Topics Covered

🧪 LAB 1 — Understanding Ports & Services (Nmap)

🎯 Goal

Understand what ports are, why SSH uses ports, and how attackers find servers.

🧠 Concept (Beginner Explanation)

A port is like a door on a server.
SSH uses port 22 by default.

Attackers scan the internet to find open doors.

🧪 Exercise

  1. Install nmap:

sudo apt install nmap -y

Enter fullscreen mode

Exit fullscreen mode

  1. Scan localhost:

nmap localhost

Enter fullscreen mode

Exit fullscreen mode

  1. Scan SSH explicitly:

nmap -p 22 localhost

Enter fullscreen mode

Exit fullscreen mode

  1. Run SYN scan (root required):

sudo nmap -sS localhost

Enter fullscreen mode

Exit fullscreen mode

🧠 What You Learn

🧑‍💼 DevOps Real-World Use

Before exposing a server, DevOps engineers scan their own infrastructure to ensure only expected ports are open.

🧪 LAB 2 — NAT & Port Forwarding (Mental Model)

🎯 Goal

Understand why SSH sometimes works locally but not from outside.

🧠 Concept

🧪 Exercise (Observation)

  1. Find local IP:

ip a

Enter fullscreen mode

Exit fullscreen mode

  1. Find gateway:

ip route

Enter fullscreen mode

Exit fullscreen mode

  1. Understand:

🧠 What You Learn

🧩 MODULE 2 — SSH FUNDAMENTALS

🔹 Lecture Topics Covered

🧪 LAB 3 — Install & Start SSH Server

🎯 Goal

Turn a machine into a real server.

🧠 Concept

SSH server = remote control service

🧪 Exercise

Ubuntu:

sudo apt update sudo apt install openssh-server -y sudo systemctl status ssh

Enter fullscreen mode

Exit fullscreen mode

CentOS:

sudo dnf install openssh-server -y sudo systemctl enable sshd --now

Enter fullscreen mode

Exit fullscreen mode

🧠 What You Learn

🧑‍💼 DevOps Reality

Every cloud VM you manage relies on SSH.

🧪 LAB 4 — SSH Connection Basics

🎯 Goal

Log into a server remotely.

🧪 Exercise

ssh user@server-ip

Enter fullscreen mode

Exit fullscreen mode

Test:

whoami hostname pwd

Enter fullscreen mode

Exit fullscreen mode

🧠 What You Learn

🧩 MODULE 3 — SSH SECURITY HARDENING (CORE DEVOPS SKILL)

🔹 Lecture Topics Covered

🧪 LAB 5 — Change SSH Port (22 → 2222)

🎯 Goal

Reduce attack surface.

🧪 Exercise

sudo nano /etc/ssh/sshd_config

Enter fullscreen mode

Exit fullscreen mode

Change:

Port 2222

Enter fullscreen mode

Exit fullscreen mode

Test:

sudo sshd -t sudo systemctl restart sshd

Enter fullscreen mode

Exit fullscreen mode

Connect:

ssh -p 2222 user@server

Enter fullscreen mode

Exit fullscreen mode

🧠 What You Learn

🧑‍💼 DevOps Reality

Every production SSH server does this.

🧪 LAB 6 — Disable Root Login

🎯 Goal

Prevent instant full compromise.

🧪 Exercise

PermitRootLogin no

Enter fullscreen mode

Exit fullscreen mode

Restart SSH.

Test:

ssh root@server

Enter fullscreen mode

Exit fullscreen mode

🧠 What You Learn

🧪 LAB 7 — AllowUsers Whitelisting

🎯 Goal

Explicitly control access.

🧪 Exercise

AllowUsers devuser

Enter fullscreen mode

Exit fullscreen mode

Test login failure for others.

🧠 What You Learn

🧩 MODULE 4 — DO NOT LOCK YOURSELF OUT

🔹 Lecture Topics Covered

🧪 LAB 8 — Two-Session Safety Practice

🎯 Goal

Never brick a production server.

🧪 Exercise

  1. Open two SSH terminals
  2. Stop SSH:

sudo systemctl stop sshd

Enter fullscreen mode

Exit fullscreen mode

  1. Observe:
  1. Restore:

sudo systemctl start sshd

Enter fullscreen mode

Exit fullscreen mode

🧠 What You Learn

🧩 MODULE 5 — SSH KEYS (ENTERPRISE AUTH)

🔹 Lecture Topics Covered

🧪 LAB 9 — SSH Key Authentication

🎯 Goal

Replace passwords with cryptography.

🧪 Exercise

ssh-keygen -t rsa -b 4096 ssh-copy-id -p 2222 user@server ssh -p 2222 user@server

Enter fullscreen mode

Exit fullscreen mode

🧠 What You Learn

🧩 MODULE 6 — DISABLE PASSWORD LOGIN

🔹 Lecture Topics Covered

🧪 LAB 10 — Enforce Key-Only SSH

🎯 Goal

Eliminate brute-force attacks.

🧪 Exercise

PasswordAuthentication no

Enter fullscreen mode

Exit fullscreen mode

Restart SSH.

Test:

ssh user@server

Enter fullscreen mode

Exit fullscreen mode

From another user → should fail.

🧠 What You Learn

🧩 MODULE 7 — KEEP SSH ALIVE

🔹 Lecture Topics Covered

🧪 LAB 11 — Prevent Connection Drops

🎯 Goal

Survive long deployments.

🧪 Exercise

nano ~/.ssh/config

Enter fullscreen mode

Exit fullscreen mode

Host * ServerAliveInterval 60 ServerAliveCountMax 3

Enter fullscreen mode

Exit fullscreen mode

🧠 What You Learn

🧩 MODULE 8 — FINGERPRINTS & MITM PROTECTION

🔹 Lecture Topics Covered

🧪 LAB 12 — Fingerprint Verification

🎯 Goal

Detect impostor servers.

🧪 Exercise

Client:

cat ~/.ssh/known_hosts

Enter fullscreen mode

Exit fullscreen mode

Server:

ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub

Enter fullscreen mode

Exit fullscreen mode

Compare hashes.

🧠 What You Learn

🧩 MODULE 9 — FILE TRANSFER (SFTP / SCP)

🔹 Lecture Topics Covered

🧪 LAB 13 — SCP & SFTP

🎯 Goal

Move data securely.

scp -P 2222 file.txt user@server:/home/user/ scp -P 2222 user@server:/home/user/file.txt .

Enter fullscreen mode

Exit fullscreen mode

GUI:

🧠 What You Learn

🧩 MODULE 10 — SCREEN (PRODUCTION SURVIVAL TOOL)

🔹 Lecture Topics Covered

🧪 LAB 14 — Screen Mastery

🎯 Goal

Survive disconnects & collaborate.

screen Ctrl+A Ctrl+D screen -x exit

Enter fullscreen mode

Exit fullscreen mode

🧠 What You Learn

🏁 FINAL CAPSTONE PROJECT

🎯 Scenario

You are the only DevOps engineer managing a production server.

You must:

  1. Harden SSH
  2. Use key auth only
  3. Prevent lockout
  4. Enable file transfer
  5. Keep sessions alive
  6. Share terminal with teammate

🎓 OUTCOME

After completing this:

For further actions, you may consider blocking this person and/or reporting abuse

Залишити відповідь

Ваша e-mail адреса не оприлюднюватиметься. Обов’язкові поля позначені *

Читайте також