1. Home
  2. Blog
  3. How to Access a Linux VPS via SSH: Beginner's Guide

How to Access a Linux VPS via SSH: Beginner's Guide

Learn how to connect to your Linux VPS via SSH from Windows (PowerShell and PuTTY), Mac, or Linux, understand each connection detail, and apply key security settings on your first login.

To access a Linux VPS, you use SSH, a protocol that opens the server's terminal over the internet. All you need is the IP address, username, password, and port, plus a single command. In a few minutes you'll be inside the server.

If this is your first time, don't worry: there's nothing mysterious here. In this guide you'll find step-by-step instructions for Windows, Mac, and Linux, what to do on your first login, and the errors that commonly appear.

How to access a Linux VPS: what SSH is and what you need first

SSH (Secure Shell) is the standard way to manage a Linux server remotely. Everything you type travels encrypted, and what you see on screen is the server's terminal, as if you were sitting in front of it.

A Linux VPS usually has no graphical interface. You install programs, edit files, and restart services using commands. If you want to better understand this foundation, read the guide on what a VPS is and how it works before continuing.

To connect, you need four pieces of information:

  • the server's IP;
  • the username;
  • the password;
  • the connection port.

Connection details you need to have on hand

Once the server is activated, your access details are available in your client area and are usually also sent by email. Always check there and copy exactly what is written.

DetailWhat it isCommon value
IPYour server's address on the internetProvided after activation
UsernameAccount used to log inroot
PasswordAccount credentialSet during activation or sent to you
PortSSH entry channel22

The root user is the full system administrator. It's used for first access, but further down you'll see why it shouldn't be your everyday account.

With a Linux VPS, you choose the distribution (Ubuntu, AlmaLinux, CentOS, or Debian) and can reinstall the system whenever you want. The SSH connection procedure is the same for all of them.

How to access a Linux VPS via SSH on Windows

On Windows you have two options: the terminal that comes with the system or PuTTY. In recent versions of Windows, the built-in terminal is usually enough. PuTTY can be useful when you want to save several servers and open each one with a few clicks.

Using the Windows terminal (PowerShell)

  1. Click the Start menu, type PowerShell, and open the program.
  2. Type the command below, replacing it with your server's actual IP:
ssh root@SEU_IP
  1. On first access, the terminal shows a warning that it doesn't recognize the server and asks whether you want to continue. Type yes and press Enter.
  2. Type the password and press Enter.

Note: when you type the password, nothing appears on screen, not even asterisks. This is intentional, for security. Type or paste it and press Enter.

If you see something like root@server-name:~#, you're in.

SSH on Windows with PuTTY

PuTTY is a free remote connection program. After installing it:

  1. Open PuTTY.
  2. In Host Name (or IP address), enter the server's IP.
  3. In Port, leave 22 (or the port you configured).
  4. For Connection type, keep SSH.
  5. To reuse the connection later, enter a name under Saved Sessions and click Save.
  6. Click Open.
  7. Accept the server key alert on first access.
  8. At login as, type root, press Enter, and then enter the password.

From then on, to return to the server, just double-click the saved session.

Accessing a Linux VPS via SSH on Mac and Linux

On Mac and Linux, SSH is usually already installed. Open the Terminal (on Mac, search for it with Spotlight; on Linux, use your desktop's shortcut or search for Terminal in the menu) and run:

ssh root@SEU_IP

The steps are the same as on Windows: accept the key with yes and enter the password.

If the server uses a port other than 22, specify it with the -p option:

ssh -p 2222 root@SEU_IP

Replace 2222 with the port you configured. The same applies to PowerShell on Windows.

How to connect to an Ubuntu VPS for the first time

To connect to an Ubuntu VPS, the command is the same. What changes is what you do right after logging in. If you've purchased an Ubuntu VPS, follow this sequence:

  1. Confirm the fingerprint. The first-access warning shows the server's identification. Accepting it is normal the first time. If it appears again without you having reinstalled the system, be suspicious and verify it.
  2. Log in with the password you received.
  3. Update the packages:
apt update && apt upgrade -y
  1. Confirm everything works with whoami (it should return root) and lsb_release -a (shows your Ubuntu version).

If the update asks you to restart, run reboot, wait a minute, and connect again.

Security precautions on your first login

A new server on the internet quickly receives automated login attempts. A few simple adjustments greatly reduce the risk:

  • Change the initial password to a long, unique one using the passwd command.
  • Create a regular user with administrator permissions (adduser name and usermod -aG sudo name on Ubuntu and Debian) and use it day to day instead of root.
  • Use SSH keys. Generate a key pair on your computer with ssh-keygen and send the public key to the server with ssh-copy-id. Afterward, you can disable password login.
  • Consider changing the SSH port in the /etc/ssh/sshd_config file. This doesn't replace the other measures, but it reduces the noise from automated attempts. Before closing your session, test the new port in another window.
  • Keep the system updated regularly with apt update && apt upgrade.

One important tip: never close your current session before testing the new configuration in a second window. That way, if something goes wrong, you can still fix it.

Common connection errors and how to fix them

MessageLikely causeWhat to do
Connection refusedSSH stopped or wrong portCheck the port and whether the service is running; use the emergency console in the panel
Connection timed outWrong IP, server powered off, or firewall blockingCheck the IP, confirm the server is on, and open the port in the firewall
Permission deniedIncorrect username or passwordCheck the username (root) and reset the password in the panel if needed
Password “not accepted”Paste error or keyboard set to a different layoutRemember that the password doesn't appear on screen; type carefully or use copy and paste
Changed host key warningServer reinstalled or IP reassignedRemove the old entry with ssh-keygen -R YOUR_IP and connect again

If you run public services, such as websites or game servers, also consider protection against attacks. Take a look at the AlmaLinux VPS, a robust alternative to CentOS, if you want a different distribution for a specific project.

Next step: set up your server and count on support

With access working, the path is open: installing a control panel, publishing a website, deploying an application, or setting up automation. Start with the security steps above and only then install the rest.

If you get stuck, HostMF's 24/7 support team, available in English and Portuguese, can help. Explore our Linux VPS plans and get your server online with no long-term contract.

Need a server to put this into practice?

Windows and Linux VPS with instant activation, NVMe SSD and 24/7 support.

View VPS plans
Cookies

By using this site, you automatically agree that we use cookies. For what?

I agree