Track · SSH and VPS
Nine short lessons to help you connect to your VPS through the terminal, understand SSH keys, and resolve the most common connection issues on your own—without waiting for technical support for every adjustment.
Lessons
Understand what happens in a remote connection and recognize the 4 elements it always needs.
Check whether SSH is already on your Windows PC and log in to your VPS for the first time, using a password.
Everyday commands for finding your way around, working with folders, and exiting safely.
Why there are two halves of a key, where they live, and the golden rule that is never broken.
The most common mistake when copying a command from the wrong place—and how to never make it again.
The step-by-step process for generating a new key of your own, instead of relying only on a password.
The complete sequence — from the key on your PC to connecting without ever typing a password again.
Stop typing the IP and key path every time—connect with just a nickname.
"Permission denied," connection refused, old key — how to diagnose each one.
Track · Lesson 1
By the end of this lesson, you’ll recognize the 4 elements every remote connection command needs — without memorizing any code.
Today, when something gets stuck in the automation running on your VPS, you depend on messaging support and waiting. The next lessons will help you handle that yourself — but first, you need to understand what’s actually happening when someone “logs in” to a server. Without that foundation, every command is just memorization.
↓ scroll to study
A VPS is a computer that stays on 24 hours a day in a data center, running your business’s automation. The SSH is the private corridor that connects your computer directly to that server — without having to travel to the data center.
After Marta, a beauty salon owner, connects via SSH to the VPS that runs automatic appointment confirmations over WhatsApp, everything she types runs there, not on her laptop.
With SSH, you can log in to the VPS and take care of things yourself that currently require support: restart a stuck service, check why a message wasn't sent, edit a file, or just confirm that everything is working.
Ricardo, a clothing store owner, uses an automation that posts new collection items on its own. When it stops posting, SSH lets him access the VPS and see what happened that same minute — instead of waiting for someone to become available.
Every SSH connection—Marta’s, Ricardo’s, anyone’s—always depends on the same 4 elements, no more and no less:
Test yourself
If you switch VPS providers (for example, Hostinger instead of AWS), which of the 4 elements changes?
A connection command looks like a row of strange symbols the first time you see it. After this lesson, it’s just this: client, server, IP, and authentication, in a fixed order—nothing more.
Marta was looking at ssh root@123.123.123.123 like a puzzle. Now she knows: it’s her client (the ssh) authenticating a user (root) at an address (123.123.123.123) — the 4 elements, in the same order as always.
Before
A connection command was a block of text to copy without understanding, hoping it would work.
Then
The same command becomes 4 recognizable pieces—and you know which one to adjust when something changes.
Practice now 0/2 done
Read the mini case below and identify the 4 elements — ~8 min.
There’s nothing here to break: this is just reading and reasoning, without touching any real VPS.
Mini case
Marta wants to log in to the VPS where her WhatsApp automation runs. She opens the terminal on her own laptop and types ssh admin@45.77.12.9. A prompt appears asking for the password; she enters it and gets in. Ricardo, at the clothing store, does the same thing, except his VPS has a different address and username.
IP: 45.77.12.9 — Marta’s VPS address. User: admin — who is authenticating. Her laptop’s terminal is the client; the SSH service running inside the VPS is the server. In Ricardo’s case, the IP and username change because they belong to a different VPS — but the 4 roles (client, server, IP, authentication) stay the same, because that’s how SSH always works.
You can now recognize the 4 elements of any SSH connection—the foundation for all the upcoming lessons.
Summary
Track · Lesson 2
By the end of this lesson, you’ll check whether SSH is already set up on your Windows computer and connect to your own VPS for the first time using a password.
All the theory from Lesson 1 only becomes useful when you open the passage for real, once. It’s the difference between knowing what a car key is and sitting in the driver’s seat.
↓ scroll to study
This is a simple recipe: you open the terminal (CMD or PowerShell), type a check command and read the response.
Marta opens the Start menu, types "cmd," opens Command Prompt, and types ssh -V. If something like OpenSSH_for_Windows, SSH is already installed — she doesn't need to do anything else at this stage.
ssh -V
correct command
$ ssh -V
OpenSSH_for_Windows_9.5, LibreSSL 3.9.2
common error
$ ssh -v
OpenSSH_for_Windows_9.5, LibreSSL 3.9.2 debug1: Reading configuration data ... (-v minúsculo liga o modo detalhado — não é isto que confirma a versão)
If the command isn’t recognized, Windows 10/11 has SSH ready to enable, without downloading anything from elsewhere: Configurações → Apps → Recursos opcionais → Adicionar recurso → OpenSSH Client.
Ricardo ran into this at the store: the command returned an error the first time, he enabled the feature using the path above, reopened the terminal, and the ssh -V worked.
Common error
Test the command without closing and reopening the terminal after enabling the feature. Windows only recognizes SSH in a new window—close the old terminal and open another one before testing again.
Once SSH is ready, connecting is just one line: ssh usuário@IP_DA_VPS. Marta types ssh root@123.123.123.123 (the IP is always the IP of her VPS, not this example).
The first time anyone connects to a new VPS, a question appears: Are you sure you want to continue connecting?. This is the computer confirming that you recognize this server—type yes and press Enter.
Test yourself
Does this confirmation prompt appear every time you connect, or only the first time with that VPS?
After the yes, the VPS asks for the password. The first time, Ricardo thought the keyboard had frozen: no letters appeared as he typed.
That’s intentional: for security, the password never appears on screen, not even as dots. Type normally and press Enter — it’s being received; it just isn’t shown.
First connection checklist
ssh usuário@IP_DA_VPS with the details for your own VPS.yes when prompted.Practice now 0/3 done
Confirm SSH is installed and log in to your VPS with a password — ~10 min.
Connecting and looking around doesn't change anything on the VPS. If something seems wrong, type exit and you exit without changing anything.
ssh -V ssh usuario@IP_DA_VPS
You just logged in to your own VPS for the first time—the same thing Marta and Ricardo do whenever they need to take a closer look at something.
Summary
yes) — only the first time.Track · Lesson 3
By the end of this lesson, you’ll find your way around your VPS, move between folders, check basic information, and exit safely.
After logging in (lesson 2), the first surprise for anyone who’s never used a terminal is not knowing where they are or what to do next. These 5 commands solve 90% of “I’m lost” moments.
↓ scroll to study
Once you’re in, you can confirm two things: where you are and what’s around you. pwd shows the path to the current folder; ls lists the files and folders inside it.
Marta logs in to the VPS and types pwd and see something like /root — the “room” where it arrived. Then type ls and see the WhatsApp automation files stored there.
pwd ls
command
$ pwd $ ls
/root automacao_whatsapp config.json logs
To open a folder, use cd nome-da-pasta ("cd" for changing directories). To go back one folder, cd .. — the two dots mean “the folder above.”
Ricardo wants to see the folder for the post automation: he types cd automacao, confirm with pwd, and when you're done looking, type cd .. to return to where you came from.
Common error
Forgetting the space between “cd” and the folder name, or misspelling the name. The terminal is very literal— cdautomacao doesn’t work, and a wrong folder name returns "not found." Check with ls the exact name before you enter.
uname -a shows system information (which Linux version is running). On servers based on Ubuntu or Debian—the most common ones for automation VPSs— sudo apt update && sudo apt upgrade -y updates the installed programs.
Marta runs this update once a month on the salon’s VPS, just like she updates her phone — it’s preventive maintenance, not a fix for a specific problem.
uname -a sudo apt update && sudo apt upgrade -y
correct command
$ sudo apt update && sudo apt upgrade -y
Lendo listas de pacotes... Pronto Todos os pacotes estão atualizados.
common error
$ apt update
Permission denied (você precisa de privilégio de administrador) E: Não é possível abrir o arquivo de trava — esqueceu o "sudo" na frente
Test yourself
Do you need to run the update command every time you log in to the VPS?
To leave the VPS and return to your own computer, type exit and press Enter. The prompt changes back, confirming that you are no longer "inside" the server.
Ricardo finishes checking the automation and types exit, and sees the terminal on his own laptop again — a sign that any command he types now runs on the laptop, no longer on the VPS.
Basic navigation checklist
pwd — where I am.ls — what’s here.cd nome / cd .. — enter / go back to a folder.exit — safely exit the VPS.Practice now 0/2 done
Run the 4 location commands and exit safely — ~10 min.
pwd, ls, uname -a e exit only read information — none of them deletes or changes anything. If something looks strange, exit always gets you out of there.
pwd ls cd nome-de-uma-pasta-que-voce-viu-no-ls cd .. exit
You just learned how to move around inside your VPS without relying on anyone to “just take a look.”
Summary
pwd e ls show where you are and what’s there—always the first step.cd enters a folder, cd .. back — the terminal is literal about names and spaces.exit exits the VPS safely and gives control back to your computer.Track · Lesson 4
By the end of this lesson, you’ll identify which file is private and which is public in your computer’s key folder — and understand why having multiple keys is normal.
Starting with lesson 6, you’ll create your own key. Before that, you need to understand what an SSH key is and where it lives — otherwise, every next step becomes memorization all over again.
↓ scroll to study
A SSH key is a way to log in without typing a password. And just as you have different keys for your house and car, it’s common to have a different SSH key for each service.
Marta has one key for the salon’s VPS and another for GitHub, where she keeps the automation code. They’re separate keys, each opening only the door it belongs to.
On Windows, keys are stored in a hidden folder called .ssh, inside your user folder: C:\Users\SEU_USUARIO\.ssh\. On Linux or Mac, the same place is called ~/.ssh/.
Ricardo found his folder at C:\Users\ricardo\.ssh\ — the same pattern, just replacing it with his Windows username.
.ssh is a drawer just for you — each key inside it opens a specific door.Inside .ssh you may find names like id_ed25519, hostinger_vps.pub, config e known_hosts. The rule for recognizing it is simple:
.pub at the end = private key..pub at the end = public key.config = connection shortcuts (lesson 8).known_hosts = list of servers already confirmed (the "yes" question in lesson 2).Test yourself
Marta sees two files: hostinger_vps e hostinger_vps.pub. Which one is the private key?
The public key (.pub) can be placed on any VPS, on GitHub, on GitLab — it only serves to "recognize" the corresponding private key, never to log in by itself.
The private key should never be shared, copied to the public cloud, or sent in a message. Ricardo keeps his only on his own laptop, just as he keeps the store's physical key with him and never lends anyone a copy of the key.
Before
A single password that anyone can try to guess by trying over and over.
Then
A key pair: the public key shared wherever needed, the private key kept only by you—impossible to guess by repeated attempts.
Practice now 0/2 done
List the files in your .ssh folder and classify each one — ~8 min.
Listing files only shows their names; it doesn’t open or change anything inside them. No risk.
dir %USERPROFILE%\.ssh
You can now recognize, in your own folder, what’s private and what can be shared.
Summary
.ssh of your user account on Windows, Linux, or Mac..pub is private, with .pub is public — and the private one never leaves your computer.Track · Lesson 5
By the end of this lesson, you’ll recognize which terminal you’re in and avoid the most common syntax mistake people make when copying a command from the wrong place.
Windows has two different terminals, and a command that works in one won’t work in the other. It’s the #1 cause of “I copied it exactly and it didn’t work”—we’ll fix this before creating your key, in lesson 6.
↓ scroll to study
Windows comes with two different terminals: CMD (Command Prompt, older) and PowerShell (newer, with more features). They both open a similar-looking window, but they understand different syntax for some things—like how to refer to your user folder.
Marta opened CMD without realizing it because she searched for "prompt" in the Start menu — PowerShell appears when you search for "powershell." Neither one is "the wrong one"; they’re just different.
Ricardo was in CMD, at the path C:\Users\ricardo\projetos\testes>, and tried to run type $env:USERPROFILE\.ssh\id_ed25519.pub — a PowerShell command typed inside CMD.
Common error
Use $env:USERPROFILE inside CMD (or %USERPROFILE% inside PowerShell). The error looks something like “the filename syntax... is incorrect”—because $env:USERPROFILE is PowerShell syntax, and CMD doesn’t understand it.
The rule is: in CMD, your user folder is written as %USERPROFILE%; in PowerShell, you write $env:USERPROFILE. It's the same place, just with a different "word" for each terminal.
Marta learned to check the window title or the prompt itself: if you see only a simple path like C:\Users\marta>, it's usually CMD; if you see PS C:\Users\marta> with “PS” at the beginning, it’s PowerShell.
From now on, every command that involves %USERPROFILE% or $env:USERPROFILE in this learning path indicates which of the two terminals it’s for—check before pasting. That was exactly the habit that kept Ricardo’s same mistake from happening again with Marta.
Quick checklist
%USERPROFILE%.$env:USERPROFILE.Practice now 0/2 done
Run the same request in both terminals, each with its own syntax — ~8 min.
We’re only listing a folder’s contents—neither command changes anything.
REM no CMD: dir %USERPROFILE%\.ssh # no PowerShell: dir $env:USERPROFILE\.ssh
You’ve just learned to recognize, before typing, which syntax each terminal expects.
Summary
$env:USERPROFILE in CMD, or %USERPROFILE% in PowerShell.Track · Lesson 6
By the end of this lesson, you’ll have your own SSH key, created by you, ready to be added to your VPS in the next lesson.
So far, you’ve only identified keys that already exist. Now it’s your turn to generate your first one — the step that frees you from typing a password every time you connect.
↓ scroll to study
Before creating a new key, it’s worth seeing what a public key looks like: a long string of text that starts with ssh-ed25519. In CMD, type shows the contents of a text file.
Marta already has the key id_ed25519.pub from an old test; it runs type %USERPROFILE%\.ssh\id_ed25519.pub and see something like ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA... minha-vps.
type %USERPROFILE%\.ssh\id_ed25519.pub
correct command
$ type %USERPROFILE%\.ssh\id_ed25519.pub
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA... minha-vps
common error
$ type %USERPROFILE%\.ssh\minha_vps.pub
O sistema não pode encontrar o arquivo especificado. (nome de arquivo errado — confira o nome exato com dir antes)
If you’d rather see the files as icons instead of text, the command explorer %USERPROFILE%\.ssh opens the folder in Windows Explorer, the same window you always use to view files.
Ricardo prefers this way: he types the command, Explorer opens, and he sees the files hostinger_vps e hostinger_vps.pub side by side, the way you’re already used to viewing folders.
Common error
Drag or copy the private key out of this folder "just to keep it somewhere easier to find." Any copy of the private key somewhere else (desktop, personal cloud storage) is one more copy that could leak — keep it only in there.
The type of key recommended today is ed25519 — more modern and secure. The creation command asks for a path and a name for your new key.
Marta chooses to call hers minha_vps, in CMD:
ssh-keygen -t ed25519 -C "minha-vps" -f %USERPROFILE%\.ssh\minha_vps
correct command
$ ssh-keygen -t ed25519 -C "minha-vps" -f %USERPROFILE%\.ssh\minha_vps
Generating public/private ed25519 key pair. Your identification has been saved in minha_vps Your public key has been saved in minha_vps.pub
common error
$ ssh-keygen -t ed25519 -C "minha-vps" -f %USERPROFILE%\.ssh\minha_vps
minha_vps already exists. Overwrite (y/n)? (já existe uma chave com esse nome — escolha outro nome em vez de sobrescrever sem querer)
After that, just press Enter for the following prompts (they ask for an optional extra password for the key — you can leave it blank and confirm).
Test yourself
After running the command above, how many new files appear in the .ssh folder?
The command from the previous step creates two files: minha_vps (private key — never share it) and minha_vps.pub (public key — can go on the VPS).
Ricardo checks the two files in his folder and can already tell which is which, applying the rule from lesson 4: no .pub is private, with .pub is public.
Checking your new key
ssh-keygen with -f pointing to the chosen name..pub.Practice now 0/2 done
Create a new key pair and choose your own name — ~10 min.
Creating a new key doesn’t delete any existing keys or change anything on your VPS — it just creates a new pair of files inside the .ssh folder. If you don’t like the name you chose, you can delete the 2 files and create them again.
ssh-keygen -t ed25519 -C "minha-vps" -f %USERPROFILE%\.ssh\<escolha um nome>
You just created your own SSH key—ready to log in to the VPS in the next lesson.
Summary
ssh-keygen -t ed25519 creates a new key pair with the name you choose..pub, corresponding to it.Track · Lesson 7
By the end of this lesson, you’ll connect to your VPS using the key you created, without typing a password at all.
You already have the key (lesson 6). One step remains: give the VPS its public half so it can recognize it, then test it. This is the longest lesson in the learning path because it brings together everything that came before—take your time.
↓ scroll to study
The rule is always the same: only the public key (the file .pub) travels to the VPS. The private key never leaves your computer — not even in this lesson.
Marta has already run ssh-keygen and has minha_vps e minha_vps.pub. She follows the steps below once, and the next time she needs to check the WhatsApp automation, she gets in without typing anything but the command. Ricardo follows the exact same sequence on the store's VPS, changing only the IP and key name.
First, view your public key on your computer (type %USERPROFILE%\.ssh\minha_vps.pub) and copy the entire text. Then, log in to the VPS with a password (lesson 2) and create the folder and file that store the authorized keys inside it:
mkdir -p ~/.ssh nano ~/.ssh/authorized_keys
O nano is a simple text editor that opens inside the terminal itself. Paste the copied public key there, and save with CTRL+O, Enter, then CTRL+X to exit. That's how Ricardo pasted the store's public key into the VPS the first time he did this step.
Complete checklist: from the key on your PC to inside the VPS
mkdir -p ~/.ssh — create the folder if it doesn’t exist yet.nano ~/.ssh/authorized_keys — paste the key and save (CTRL+O, Enter, CTRL+X).command
$ mkdir -p ~/.ssh $ nano ~/.ssh/authorized_keys
(o nano abre uma tela de edição — cole a chave, CTRL+O, Enter, CTRL+X)
O permissions of the folder and file must be correct, or the VPS will ignore the key for security. Still inside the VPS, run:
chmod 700 ~/.ssh chmod 600 ~/.ssh/authorized_keys
Ricardo forgot this step on his first try, and his key simply didn’t work — with no clear error message. After adjusting the permissions, it worked on the first try.
correct command
$ chmod 700 ~/.ssh $ chmod 600 ~/.ssh/authorized_keys
(nada aparece — no Linux, silêncio depois de um comando quase sempre significa sucesso)
common error
$ ssh -i minha_vps root@IP_DA_VPS (pulando o chmod)
root@IP: Permission denied (publickey,password). (a VPS recusa a chave porque as permissões da pasta .ssh estão abertas demais)
Test yourself
If you skip the step for chmod, what is likely to happen when you try to connect with the key?
Type exit to exit the VPS, return to your computer and connect again — this time specifying which key to use, with -i:
ssh -i %USERPROFILE%\.ssh\minha_vps usuario@IP_DA_VPS
If everything is set up correctly, Marta gets right in—no password prompt. The key is all she needs.
Before
Every connection asked for a password, and you had to remember it or copy it from somewhere.
Then
The key proves who it is on its own — a faster, more secure connection, with no password at all.
correct command
$ ssh -i %USERPROFILE%\.ssh\minha_vps root@123.123.123.123
Welcome to Ubuntu 22.04 LTS root@vps:~#
common error
$ ssh -i %USERPROFILE%\.ssh\minha_vps root@123.123.123.123
root@123.123.123.123's password: (ainda pediu senha — a chave não foi aceita: revise o authorized_keys e o chmod)
Practice now 0/4 done
Follow the complete sequence, from your computer to the VPS recognizing your key — ~15 min.
You can always log in again with a password (lesson 2) if something gets stuck here—none of the steps in this exercise erase your existing password access.
type %USERPROFILE%\.ssh\minha_vps.pub ssh usuario@IP_DA_VPS mkdir -p ~/.ssh nano ~/.ssh/authorized_keys chmod 700 ~/.ssh chmod 600 ~/.ssh/authorized_keys exit ssh -i %USERPROFILE%\.ssh\minha_vps usuario@IP_DA_VPS
You can now log in to your VPS using only the key—the same workflow Marta and Ricardo use every day, without relying on tech support.
Summary
~/.ssh/authorized_keys, on the VPS itself.chmod 700 in the folder, chmod 600 in the file) are required—without them, the VPS ignores the key.-i pointing to the key removes the need to enter a password.Track · Lesson 8
By the end of this lesson, you’ll connect to your VPS by typing just a nickname, without repeating the IP, username, and key path every time.
The command from lesson 7 works, but it’s long to repeat every day. A 4-line file takes care of that for good.
↓ scroll to study
Every day, to access the VPS with the key, you have to remember (or copy from somewhere) a whole command: username, IP, and key path. It’s easy to mistype a character along the way.
Ricardo kept the full command written down in a notepad, just to paste it whenever he needed it — it worked, but it was an unnecessary extra step.
On your computer, inside the folder .ssh, you can create a file named exactly config (with no extension), with a block similar to this:
Host hostinger
HostName 123.123.123.123
User root
IdentityFile ~/.ssh/minha_vpsMarta creates hers with the nickname salao, replacing the IP and username with the ones for her own VPS.
Common error
Forgetting the indentation (spaces) before each line after “Host”. The config file follows a format where the lines below “Host” need to be indented—without that, connecting with the nickname won’t work.
correct command
$ ssh hostinger
Welcome to Ubuntu 22.04 LTS root@vps:~#
common error
$ ssh hostinger
ssh: Could not resolve hostname hostinger: Name or service not known (o arquivo config existe, mas as linhas abaixo de "Host" não estavam recuadas)
Host is the nickname you choose (the name you’ll type). HostName is the VPS’s real IP address. User is the user. IdentityFile points to the private key that should be used.
Test yourself
In Ricardo’s example, which line does he need to change to point to the key he created in lesson 6?
After saving the file, the connection command becomes just: ssh hostinger — instead of typing the username, IP, and key path every time. Marta does this in seconds today, in the middle of a busy day with clients at the salon.
Shortcut checklist
config inside the folder .ssh.Host / HostName / User / IdentityFile, indented.ssh <apelido escolhido>.Practice now 0/2 done
Write the config file and connect using just the nickname — ~8 min.
The config file only affects your computer, not the VPS—if you get something wrong, just reopen it and fix it, with no risk of locking up the server.
Host <escolha um apelido>
HostName IP_DA_SUA_VPS
User <seu usuario>
IdentityFile ~/.ssh/minha_vpsYou just reduced the entire connection process to a single word—your nickname.
Summary
config, inside the .ssh folder, stores connection nicknames.Host (nickname), HostName (IP), User e IdentityFile (key).ssh <apelido>.Track · Lesson 9
By the end of this lesson, you’ll diagnose the 4 most common connection errors on your own and know what action to take for each one.
At some point, a connection will fail — that’s normal and doesn’t mean you’ve done something fundamentally wrong. What makes all the difference is recognizing the message and knowing where to start investigating.
↓ scroll to study
SSH always returns a message when something fails—and that message already points you in the right direction for troubleshooting. The 4 most common ones are: Permission denied, Connection timed out, Connection refused, and an error saying the "fingerprint" had changed.
Marta, the first time she saw Permission denied, thought he had broken something. He hadn't: he'd just typed the wrong username.
This message means the connection reached the VPS, but authentication failed. The most common causes are: wrong password, wrong user, wrong key, or the public key wasn’t added to authorized_keys, or the folder permissions .ssh are wrong (lesson 7). That was exactly the message Marta saw on her first attempt, because she typed the wrong username.
Common error
"Permission denied" when trying to connect to -i using the key. Before suspecting the key itself, check: the file authorized_keys has exactly the right key pasted in, and the permissions are set to 700/600.
Connection timed out means the request never got a response — usually the IP is wrong, the VPS is turned off, or a port is blocked by a firewall. Connection refused means the VPS responded with "no" — the SSH service may be turned off on it, or the port being used is wrong.
Ricardo recreated the store’s VPS once, and when he tried to connect again, he got a warning that the server’s “fingerprint” had changed — the command ssh-keygen -R IP_DA_VPS clears the old saved signature and lets you connect again, accepting the new one.
If you’re already on the VPS (for example, by logging in with a password after a key failure), systemctl status ssh (or sshd, depending on the system) shows whether the service is active. Ricardo used this command when the store's post automation stopped responding, and confirmed that the service was running — the problem was something else.
systemctl status ssh sudo systemctl enable ssh sudo systemctl start ssh
Final checklist: from scratch to connecting with a key
correct command
$ systemctl status ssh
● ssh.service - OpenBSD Secure Shell server
Active: active (running)
common error
$ systemctl status sshd
Unit sshd.service could not be found. (neste sistema o serviço se chama "ssh", não "sshd" — tente o outro nome)
Practice now 0/2 done
Read the 2 mini cases and identify the most likely cause of each — ~8 min.
This is only reading and reasoning — no real VPS is touched in this exercise.
Case 1. Marta tries to connect with ssh -i ~/.ssh/minha_vps admin@45.77.12.9 and receives Permission denied. She confirms that the IP and username are correct.
Case 2. Ricardo tries to connect to the store’s VPS, and the terminal sits idle for a minute until Connection timed out. He confirms in another service's browser that the VPS is online.
Case 1: since the IP and username have already been confirmed, the most likely cause is that the public key wasn’t pasted correctly into authorized_keys, or the folder permissions .ssh/file to be wrong—the same diagnosis as step 2 of this lesson. Case 2: "timed out" (no response at all) points to a network problem before the connection even reaches SSH — a firewall blocking the port is the most common cause when the VPS is confirmed to be on.
You can now diagnose connection problems from the error message, without relying on anyone else to understand what’s going on.
Summary
systemctl status ssh, directly on the VPS, confirms whether the service is active.