0Pricing
DevOps Bootcamp · Lesson

Secure Shell (SSH) Fundamentals

Learn how to securely connect to remote Linux machines, including key-based authentication and basic SSH client configuration.

Secure Shell (SSH) Fundamentals is a free DevOps Bootcamp lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the DevOps Bootcamp learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

What is Secure Shell (SSH)?

Welcome to Secure Shell (SSH) Fundamentals! SSH is a powerful network protocol that allows you to securely connect to a remote computer over an unsecured network.

Think of it as a secure tunnel for your commands and data. It's essential for managing Linux servers, cloud instances, and even accessing your own development environment remotely.

Why Use SSH? Security First!

Before SSH, remote connections were often unencrypted, meaning anyone could snoop on your passwords and data. SSH solves this with strong encryption.

  • Confidentiality: Your data is encrypted, hidden from prying eyes.
  • Integrity: Ensures data isn't tampered with during transit.
  • Authentication: Verifies the identity of both client and server.

It's the industry standard for remote administration.

SSH: Client-Server Model

SSH operates on a client-server model. You, the user, run an SSH client on your local machine. This client connects to an SSH server (often called `sshd`) running on the remote machine.

When you initiate a connection, the client and server perform a 'handshake' to establish a secure, encrypted channel before any data is exchanged.

Basic SSH Connection Command

The most fundamental way to connect to a remote server via SSH is using the ssh command followed by the username and the host (IP address or hostname).

The format is ssh username@hostname_or_IP. For example, to connect to a server at 192.168.1.100 as user coddy:

ssh coddy@192.168.1.100

First Connection & Fingerprints

The very first time you connect to a new server, SSH will ask you to verify the server's 'fingerprint'. This is a unique identifier that helps prevent 'man-in-the-middle' attacks.

Always verify the fingerprint if possible (e.g., asking the server administrator). If it matches, type yes to add the server to your ~/.ssh/known_hosts file.

SSH Port & Custom Ports

By default, SSH uses TCP port 22. However, for security reasons, server administrators often configure SSH to listen on a different, non-standard port.

If the remote server uses a custom port (e.g., port 2222), you can specify it using the -p option:

ssh -p 2222 coddy@myremoteserver.com

Introducing Key-Based Authentication

While password authentication works, SSH key-based authentication is far more secure and convenient. It uses a pair of cryptographic keys:

  • Public Key: Stored on the remote server.
  • Private Key: Stored securely on your local machine.

When you connect, the server challenges your client, which uses the private key to prove its identity without ever sending the private key over the network.

Generating SSH Key Pairs

You can generate an SSH key pair using the ssh-keygen command. It will prompt you for a location to save the keys (default is ~/.ssh/id_rsa) and an optional passphrase.

A passphrase adds an extra layer of security to your private key. It's highly recommended!

ssh-keygen -t rsa -b 4096

Copying Your Public Key

Once you have a key pair, you need to copy your public key to the remote server. The easiest way is using ssh-copy-id. This command logs into the remote server (using your password initially) and adds your public key to the ~/.ssh/authorized_keys file.

After this, you can connect using your key instead of a password!

ssh-copy-id coddy@myremoteserver.com

Quick Check: SSH Basics

Which of the following statements about SSH are true?

Recap: SSH Fundamentals

In this lesson, you've learned the fundamentals of Secure Shell (SSH)!

  • SSH provides secure, encrypted remote access.
  • It operates on a client-server model, typically using port 22.
  • You can connect with ssh user@host.
  • Key-based authentication using public/private key pairs (generated with ssh-keygen and copied with ssh-copy-id) offers superior security compared to passwords.

Next, we'll explore even more powerful network commands and file transfer tools!

Frequently asked questions

Is the “Secure Shell (SSH) Fundamentals” lesson free?

Yes — the full text of “Secure Shell (SSH) Fundamentals” is free to read here on the web, and the DevOps Bootcamp course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the DevOps Bootcamp course, upgrade to CoddyKit PRO.

What will I learn in “Secure Shell (SSH) Fundamentals”?

Learn how to securely connect to remote Linux machines, including key-based authentication and basic SSH client configuration. You practise DevOps Bootcamp with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start DevOps Bootcamp?

No prior experience is required. DevOps Bootcamp on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Secure Shell (SSH) Fundamentals” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this DevOps Bootcamp lesson?

Yes. Every DevOps Bootcamp lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Basic Network Utilities (ping, ip, netstat)
  2. Secure Shell (SSH) Fundamentals
  3. SCP and Rsync for File Transfers
  4. SSH Key Authentication & the Config File
← Back to DevOps Bootcamp