Thuta Learning
AdvancedDevOps & Toolsbeginner

SSH — Connecting to a Remote Server Securely

Relax. We'll talk through this in plain words — no textbook voice.

What you'll walk away with

  • Understand SSH — Connecting to a Remote Server Securely without any of the intimidation
  • Get hands-on practice trying out the commands yourself in the terminal
  • See how these commands actually come in handy on a real server or project

Let's think about it this way for a second

SSH (Secure Shell) is a protocol that lets you log into a remote computer over an encrypted connection and run commands on it — you connect with ssh username@server-ip, and you can log in either by typing a password or with an SSH key (a password-free authentication method). An SSH key works as a key pair (public + private) — you keep the private key only on your own computer, copy the public key over to the server, and never, under any circumstances, share the private key file with anyone (think of a private key as the key to your own house). ssh-keygen is the command for generating a new key pair, and ssh-copy-id is the command for copying your public key over to a server.

Let's connect this to a real-world scenario

Once you've provisioned a cloud server (VPS) on AWS, DigitalOcean, GCP, or similar, 'meeting up with the server' means running ssh root@your-server-ip (or as an ordinary user) to get direct terminal access — and this is where the authentication method (password vs. key) acts like a bodyguard protecting the connection. Once you've set up an SSH key, you no longer need to type a password — just ssh user@ip and you're straight in — which is both more secure and more convenient than password-based login.

Let's try it together in the terminal

bash
ssh alice@203.0.113.10
ssh-keygen -t ed25519 -C "my-email@example.com"
ssh-copy-id alice@203.0.113.10
ssh alice@203.0.113.10   # password မလို, key နဲ့ တန်းဝင်ပါပြီ
You should see
Running ssh username@server-ip switches your prompt to the remote server's prompt (username@server-hostname:~$).

5-minute try-it

Run ssh-keygen -t ed25519 on your own machine (you can leave the passphrase empty, since this is just practice). Check where the key file ended up under ~/.ssh/ with ls -la ~/.ssh.

A quick word of caution

Leaving a server's SSH port (default 22) open to the whole internet with password-only login makes it a target for bot attacks — prioritizing SSH key authentication and disabling password login is a security best practice.

Easy traps

  • Sharing a private key file over email or chat — a private key is like a password, and should never be shared with anyone
  • Leaving out the username when connecting via SSH (ssh user@ip) and letting it auto-guess from the local machine's username, causing an error

Now try it yourself

Run ssh-keygen -t ed25519 on your own machine (you can leave the passphrase empty, since this is just practice). Check where the key file ended up under ~/.ssh/ with ls -la ~/.ssh.

You'll know it worked when: Running ssh username@server-ip switches your prompt to the remote server's prompt (username@server-hostname:~$).

SSH — Connecting to a Remote Server Securely | Thuta Learning