Your DevOps study space

Real explanations. Videos with tests. Fresh exams every time. Keep the streak alive and watch the XP stack up.

Remote servers & SSH · Linux Docs · StackwisePlanDevOps Remote servers & SSH · Linux Docs · StackwiseCodePython Remote servers & SSH · Linux Docs · StackwiseBuildDocker Remote servers & SSH · Linux Docs · StackwiseTestDevOps Remote servers & SSH · Linux Docs · StackwiseReleaseGit Remote servers & SSH · Linux Docs · StackwiseDeployKubernetes Remote servers & SSH · Linux Docs · StackwiseOperateLinux Remote servers & SSH · Linux Docs · StackwiseMonitorDevOps

Pick a topic

Eight tracks, each with docs, a cheat sheet, videos and tests.

How it works

One loop, repeated until it sticks.

Jump back in

Picked up from where you left off.

Free forever

Your DevOps journey starts with one click.

Sign in with Google or GitHub to open every chapter, video, test and challenge. Your progress is saved wherever you learn.

Remote servers & SSH

Real servers live in a data centre or the cloud, so you manage them remotely. This chapter follows what the Traversy "Linux Server Setup" video does step by step: create a server, log in securely with keys, lock it down, and put a web app behind Nginx with HTTPS.

How SSH works

SSH (Secure Shell) gives you a terminal on another machine over an encrypted connection. The server runs an SSH daemon (sshd) listening on port 22; your laptop runs the client, ssh. Everything you type and everything the server prints travels encrypted, so nobody in between can read it.

$ ssh [email protected]          # user@server-address
$ ssh -i ~/.ssh/work_key demee@server   # use a specific key
$ exit                            # leave the remote shell

Key pairs instead of passwords

Passwords can be guessed, and servers on the internet get thousands of guessing attempts a day. SSH keys fix that. ssh-keygen creates a pair of matching keys:

  • the private key (~/.ssh/id_ed25519) stays on your laptop and is never shared;
  • the public key (~/.ssh/id_ed25519.pub) is copied to every server you want to log in to, into ~/.ssh/authorized_keys.

When you connect, the server sends a challenge that only the matching private key can answer. Your private key never leaves your machine, so there is nothing to guess or steal from the network.

$ ssh-keygen -t ed25519 -C "demee laptop"   # make the pair (Enter for defaults)
$ ssh-copy-id [email protected]             # install the public key on the server
$ ssh [email protected]                     # now logs in without a password

GitHub uses exactly the same idea: you paste your public key into GitHub's settings so git push can authenticate you.

your laptopserverprivate key~/.ssh/id_ed25519never leavespublic keyin ~/.ssh/authorized_keys1 ssh demee@server2 a random challenge3 answer signed with private key4 checks it with public key: in
Nothing secret crosses the network. The server only ever sees the signed answer, and the public key is useless to anyone who copies it.

First things to do on a new server

  1. Update it: sudo apt update && sudo apt upgrade.
  2. Create a normal user and give it sudo, so you stop working as root: adduser demee, usermod -aG sudo demee, then copy your public key into that user's ~/.ssh/authorized_keys.
  3. Turn off password logins and root login in /etc/ssh/sshd_config: set PasswordAuthentication no and PermitRootLogin no, then sudo systemctl restart ssh. Test a new key login in a second terminal before closing the first one, so you can't lock yourself out.
  4. Turn on a firewall that only lets in what you need:
$ sudo ufw allow OpenSSH     # keep SSH open first!
$ sudo ufw allow 80          # HTTP
$ sudo ufw allow 443         # HTTPS
$ sudo ufw enable
$ sudo ufw status

Copying files to and from servers

$ scp app.tar.gz demee@server:/srv/        # copy up
$ scp demee@server:/var/log/app.log .      # copy down
$ rsync -avz site/ demee@server:/var/www/  # sync a folder, only sending changes

Serving an app: Nginx as a reverse proxy

Your app (say a Node server on port 5000) shouldn't face the internet directly. Instead Nginx listens on ports 80/443 and forwards requests to the app. That is a reverse proxy: visitors only ever talk to Nginx, which also handles HTTPS, compression and serving static files efficiently.

browservisitoryour server (firewall: only 22, 80, 443 open)Nginx:80 / :443your applocalhost:5000HTTPSproxy_passthe app is never reachable from outside
Visitors only ever talk to Nginx. Port 5000 stays closed in the firewall, so the app is reachable only through the proxy.
# /etc/nginx/sites-available/default
server {
    listen 80;
    server_name demee.cc;
    location / {
        proxy_pass http://localhost:5000;   # hand the request to the app
    }
}
$ sudo nginx -t                  # check the config for typos
$ sudo systemctl reload nginx    # apply it

Finally point your domain's DNS A record at the server's IP, and get a free HTTPS certificate from Let's Encrypt with sudo certbot --nginx -d demee.cc. Certbot edits the Nginx config for you and renews the certificate automatically.

Questions

Pick an answer. Get it wrong and you can try again right away, no waiting. 10 questions per topic - pick a filter below, then use Recreate questions for a fresh set on that topic.

Fresh questions every time

Exam

A mixed test across the whole site, shuffled so you never know which topic comes next. When you submit, every mistake comes with the reason and a jump to the exact moment in the video that explains it.

30 questions 6 topics 20 minute limit Up to 70 XP
1–4 answer · ←→ move
History

Essay

0 / 200-250 words
Sample answer
History
0:00 / 0:00
Not started

on YouTube
Subscribe

Topic progress

Activity

Achievements

Settings

Your profile and your account.

Profile details

* Required. Saved in this browser until you sign in.

Letters, numbers, dots, dashes and underscores.
0 / 160

Account

Checking…

App

Install Stackwise on your phone or computer. It opens in its own window from your home screen, and the Docs and cheat sheets you've opened keep working without internet.

Only admins can see this

Dashboard

Sign-ups, activity, messages and reviews in one place.

Prove it

Certificates

Pass a topic's test and get a certificate with its own public page you can share or add to LinkedIn. Each test is 10 questions drawn at random and graded on the server; you need 8 right, you have 15 minutes, and you get one try per topic a day.

From first command to production

Linux for DevOps

A path through Linux the way DevOps engineers use it: ten stages, every command explained with its flags, examples, real output and mistakes, the combinations engineers chain together, and incidents worked through step by step. Practise everything in a safe lab folder.

Before the interview

Interview prep

Questions that come up in real DevOps interviews, with the kind of answer that lands. Say yours out loud first, then compare. Each one links to the chapter that goes deeper.

    Private to you

    My notes

    Everything you wrote down while watching and reading, in one place. Saved to your account, never shown to anyone.