๐Ÿš€ From Zero to LiveVPS + Claude ยท free course

Home โ€บ Module 3

Module 3 ยท Connecting to Your Server

Say hello to your server for the first time

Your server is sitting out there right now, waiting. In this module you'll open a plain text window, make a safe digital key, and use it to log in โ€” for real, over the internet. It sounds technical, but it's really just typing a few words and pressing Enter.

๐ŸŽฏ Goal of this module

Get onto your server and get comfortable in a terminal.

What is SSH, and what's a terminal?

Your VPS doesn't have a screen or a mouse. You control it entirely by typing words into a box and pressing Enter. That box is called a terminal. It looks plain and a little old-fashioned, but it's just a place to type โ€” nothing more mysterious than that.

To send those typed commands safely to your server, over the open internet, you use SSH. Picture a locked, private phone line running straight from your laptop to your server. Nobody can listen in along the way, and only you can pick up the other end. SSH is the front door you'll knock on every single time you visit your server.

๐Ÿ’ก

In plain words

Typing commands isn't scary โ€” it's just clicking, but with words instead of a mouse. Give it ten minutes and it'll feel completely normal.

Opening your terminal

Every computer already has one built in. You don't need to download anything.

  • Mac: open Applications โ†’ Utilities โ†’ Terminal.
  • Windows: open Windows Terminal or PowerShell. Modern Windows already understands SSH, so there's nothing extra to install.
  • Linux: open your regular Terminal app.

Go ahead and open it now. Keep it up for the rest of this module โ€” you'll be typing into it a lot.

SSH keys are safer than passwords

You could log into your server with a password, but there's a better way: a key pair. Think of it as a special lock and its one matching key. The lock โ€” your public key โ€” sits on the server, out in the open. The only key that opens it โ€” your private key โ€” never leaves your computer. There's no password for anyone to guess or steal.

Make your key pair

In your terminal, type this and press Enter:

terminal
ssh-keygen -t ed25519 -C "you@example.com"

This creates two files for you. When it asks where to save them, just press Enter to accept the default location. It will also ask for a passphrase โ€” that's optional. Think of it as a second lock on your private key; you can leave it blank for now and add one later once you're comfortable.

Look at your public key

Now let's see the key you'll be sharing with your server:

terminal
cat ~/.ssh/id_ed25519.pub

The file ending in .pub is your public key โ€” that's the one that's safe to share, even to paste into a website. The other file, with no .pub at the end, is your private key. Never share that one with anyone, ever.

โš ๏ธ

Watch out

Keep your private key safe and never paste it into a chat, an email, or a website. If you ever lose access to it, don't panic โ€” most providers let you back in through a web console right in your browser, no key required.

Getting your key onto the server

Your server needs a copy of your public key so it can recognize you. There are two easy ways to do this:

  • Easiest: paste your public key into your provider's control panel. Most providers show an "Add SSH key" box when you create a server (Module 2) โ€” just paste in what cat ~/.ssh/id_ed25519.pub printed out.
  • If you already started with a password: run this from your terminal, and it copies your key over for you automatically:
terminal
ssh-copy-id root@YOUR_SERVER_IP

Either way works fine. Once your key is on the server, you're ready to connect.

Connect to your server

This is the moment. Type this into your terminal, swapping in the IP address from Module 2:

terminal
ssh root@YOUR_SERVER_IP

root is the name of the main administrator account on your server โ€” the one with full control. The first time you connect, you'll see a message asking if you're sure you want to continue. That's completely normal; type yes and press Enter.

When it works, your prompt will change to show your server's name instead of your own computer's name. That's it โ€” you're in. You're now typing commands directly on a computer somewhere across the world.

Survival commands

You only need a handful of commands to get around comfortably. Here are the essentials, each with a one-line explanation.

terminal
pwd        # "print working directory" โ€” where am I right now?
ls -la     # list everything in this folder, including hidden files
cd notes   # move into a folder called "notes"
cd ..      # move back up one folder
whoami     # which user am I logged in as?

And here's how to make a folder, create a text file, and read it back:

terminal
mkdir test         # make a new folder called "test"
nano notes.txt     # open a simple text editor to write a file
cat notes.txt      # print the contents of the file to the screen

Inside nano, just type normally. When you're done, press Ctrl+O then Enter to save, and Ctrl+X to exit back to your prompt.

A peek at permissions

Every file on your server has rules about who can read it, write to it, or run it โ€” called permissions. When you run ls -l, you'll see letters like rwx next to each file, which stand for read, write, and execute. As a beginner, you'll rarely need to change these by hand. The command for it, if you ever need it, is called chmod โ€” just good to recognize the word when you see it.

๐Ÿงญ

Good to know

You don't need to memorize permissions today. Later modules will point out exactly when (and how) to adjust them.

โœ๏ธ Hands-on: take control

Time to actually do it. Follow these steps in your own terminal.

  1. Open your terminal.

    Use the app for your system, as described above.

  2. Connect to your server.

    Type ssh root@YOUR_SERVER_IP, using your real IP address from Module 2. Type yes if asked.

  3. Look around.

    Run pwd, then ls -la, then whoami. Notice how each one answers a different question about where you are.

  4. Make something and read it back.

    Run mkdir test, then cd test, then nano notes.txt. Type a sentence, save with Ctrl+O and Enter, exit with Ctrl+X, then run cat notes.txt to see it printed back.

Take a second to notice what just happened: you just controlled a computer on the other side of the world, just by typing.

โœ…

You did it

You've logged into a real server, moved around, and created a file. That's the exact same skill professional developers use every day โ€” and you just used it too.

โœ… Recap
  • SSH is a secure, private line to your server; the terminal is where you type the commands.
  • An SSH key pair is safer than a password โ€” a public key on the server, a private key that stays with you.
  • Connect with ssh root@YOUR_SERVER_IP, typing yes the first time.
  • A handful of commands โ€” pwd, ls -la, cd, mkdir, nano, cat, whoami โ€” cover almost everything you'll need early on.