How to Connect to a VPS via SSH (Windows, macOS, Linux)

5/5 - (2 votes)

Once you’ve successfully created a VPS from providers like Vultr, Digital Ocean, Linode, etc., you’ll need to connect to the VPS using SSH to run the necessary commands for various purposes.

If you need guidance on how to connect from a Windows, macOS, or Linux computer to a VPS using SSH, this article will be helpful for you. Let’s continue with the instructions below.

SSH CONNECT

How to Connect to an SSH Server (Windows)

Windows users have several options for connecting to SSH servers, ranging from built-in tools to third-party applications. 

Installing OpenSSH Client on Windows

Windows 10 and 11 have an optional OpenSSH client that can be easily installed through the Settings app. Here’s how to get it up and running:

OpenSSH Client
  1. Open the Windows Settings app by pressing Win + I.
  2. Navigate to Apps > Apps & Features > Optional Features.
  3. Click “Add a feature” and search for “OpenSSH Client.”
  4. Select it and click “Install.”
OpenSSH Client

Once installed, you can use the SSH command directly from PowerShell or Windows Terminal, bringing a Linux-like experience to your Windows machine.

Using PowerShell or Windows Terminal

With OpenSSH Client installed, connecting to an SSH server becomes straightforward:

Windows Terminal SSH

Open PowerShell or Windows Terminal and use the following command syntax:

ssh username@youripvps
Windows Terminal SSH

Replace “username” with your account username on the remote server and “youripvps” with the appropriate server address.

For non-standard ports, add the -p flag followed by the port number:

ssh username@youripvps -p port_number

Using PuTTY

While the built-in OpenSSH client is sufficient for most users, PuTTY remains popular due to its graphical user interface and additional features. Here’s how to use PuTTY:

PuTTY
  1. Download PuTTY from the official website and install it.
  2. Launch PuTTY and enter the server’s hostname or IP address in the “Host Name” field.
  3. Ensure the connection type is set to SSH.
  4. If needed, specify a custom port in the “Port” field (default is 22).
  5. Click “Open” to initiate the connection.
PuTTY

PuTTY offers advantages like saved sessions, various connection options, and a built-in key generator, making it a versatile choice for Windows users.

Using WinSCP

While PuTTY is excellent for command-line access, WinSCP is a powerful tool for file management over SSH. It provides a graphical user interface that easily transfers files between your local machine and your VPS.

To get started with WinSCP, download the installer from the official website. The installation process is straightforward—follow the prompts until completion. 

Here, you will need to fill in the following fields:

WinSCP
  1. File Protocol: Select “SFTP” from the dropdown menu. SFTP is a secure file transfer protocol that operates over SSH.
  2. Host Name: Enter the IP address of your VPS.
  3. Port Number: Again, ensure this is set to 22.
  4. User Name: Input “root.”
  5. Password: Enter the password provided in your provider.
WinSCP

You can save this session for quick access later by clicking the “Save” button.

How to Connect to an SSH Server (macOS)

macOS, being a Unix-based operating system, comes with built-in SSH functionality, making it straightforward for users to connect to SSH servers.

The Terminal application is the go-to tool for SSH connections on macOS. 

Open Terminal (Applications > Utilities > Terminal) and then use the ssh command followed by the username and server address:

ssh username@youripvps
ssh vps login

This simple command structure works for most standard SSH connections. For servers using non-standard ports, add the -p flag followed by the port number:

ssh username@youripvps -p 2222

Here is an example: ssh root@138.111.12.152 -p 8282

How to Connect to an SSH Server (Linux)

Linux, as the native environment for many SSH servers, provides robust and flexible options for SSH connections. Open your preferred terminal emulator, then use the ssh command with the following syntax:

ssh username@youripvps
linux login ssh

For non-standard ports, add the -p flag:

ssh username@youripvps -p port_number

Fixing the RSA Error (macOS and Linux)

When you access a VPS from macOS or Linux using the Terminal, your computer stores the VPS details, however, if you need to reinstall the VPS OS, you might encounter an error when logging in via SSH.

To resolve this issue, use the following command and hit Enter:

ssh-keygen -R IP
RSA Error

Make sure to replace the IP with the actual IP address of your VPS. For example:

ssh-keygen -R 149.28.128.125

Conclusion

I wrapped up a talk about connecting Windows, macOS, and Linux systems to VPS services from popular providers like Vultr, DigitalOcean, and Linode. If you have any questions about this post, leave a comment below.

Tags:

We will be happy to see your thoughts

Leave a reply

All About WordPress Blog, Hosting, VPS and Domain
Logo