Amaze Sevrers Logo

How to Access Your VPS Using SSH (Windows, Mac, or Linux)

How to Access Your VPS Using SSH (Windows, Mac, or Linux)

Virtual private servers are nowadays a basic option for hosting for businesses all over the globe. A growing number of companies are using VPS to host their operations online. Despite so much popularity, it is still a mystery for many to access their VPS using SSH in different operating systems. Whether you’re running a website, hosting an application, or just setting up a personal cloud, understanding and learning to access a VPS through SSH securely is essential.

So, here in this blog we are walking through the step-by-step and in-depth guide on accessing your VPS hosting via secure shell on Windows, macOS, and Linux. After reading this blog, you’ll master the process of accessing your VPS on any OS securely and confidently. Let’s begin:

Why is SSH essential to use, and what is it?

Secure Shell, also known as SSH, is a cryptographic network protocol that enables safe communication between two computers. Thus, it is used to control VPS hosting remotely with a command line interface (CLI) and makes the server management easy.

There are other options like FTP and TELNET to access your VPS hosting but what sets SSH apart is its encryption facility; that means all the sessions will be encrypted with SSH, which prevents malicious traffic and attacks.

Why Use SSH to access your VPS

Using Secure Shell for accessing your VPS hosting comes with many benefits, like

  • Security: It provides fully encrypted data access, making it one of the secure protocols for server access.
  • Speed: Accessing and controlling your VPS hosting is smooth and efficient with SSH, thus resulting in Faster and speedier access
  • Remote Control: Secure shell allows accessing and managing the server from anywhere with the same security and speed. All you need is the right approach and your server will be in your control, no matter where you are.
  • Automation: You can use scripts and commands easily with SSH and manage your server effectively.

Things you need before accessing your VPS for any Operating system

To access your VPS server via SSH, you need some basic information ready. This includes:

  • IP address of your VPS hosting
  • SSH port number (By default it comes as 22 unless it is changed manually)
  • Root user credentials: Username and Password
  • SSH key Pair (Not mandatory if you have password login enabled)

Accessing VPS using SSH in different platform

Let us now understand all the methods for accessing your VPS through SSH on different platforms, including Windows, macOS, and Linux:

How to access VPS hosting using SSH on Windows

Compared to the previous version of Windows, the latest version has upgraded so much. One of these upgrades includes the support for SSH in PowerShell, which was not a part of traditional Windows versions.

This latest support in PowerShell allows accessing the VPS directly without needing any third-party software. Additionally, even if you prefer third-party software, PuTTY remains one of the popular choices.

Here we are sharing both ways to access your VPS with SSH

Option 1: Through PowerShell SSH (Windows 10/11)

Step 1:

Since Windows 10 and 11 allow SSH access through PowerShell, you can directly open PowerShell in your Windows. To Open the the PowerShell, you can simply click the Windows + X key and then click on the terminal or PowerShell option

vps ssh access

Step 2:

Once you open PowerShell, you can now run your SSH command directly from here without needing any other application.

All you need to do here is type your username and IP address in the following way:

Format: username@your_server_ip

Eg: root@192.168.1.100 

Step 3: Accept the notification

Now, you will be notified with the question of whether if you trust the host or not; to enter into your VPS, just type yes and get into it

Step 4: Enter your password:

This is the last step where you need to enter your password for SSH to start managing your server through SSH. Just type your password correctly, and you are now fully in your VPS environment, where you can manage and control everything the way you want.

Option 2: Through PuTTY (Order version of windows Or GUI preference)

However, we also have the option for you to access your Windows through SSH if you are running older versions of Windows or if you are not interested in using PowerShell to access your VPS.

Step 1:

For this, first you need to download and install software named PuTTY. It is an open-source SSH and Telnet client that allows you to run SSH freely. This step is as simple as downloading and installing any other software on your Windows. So, no further explanation is needed

how to ssh into vps

Step 2:

Once the software is installed, open PuTTY and enter the necessary details asked for, which include the following:

  • In the “host name or IP address” section, enter the IP address of your VPS hosting.
  • Leave the port section as 22 if it is default, or enter the custom port if you have previously changed your SSH port.
  • Set connection type as SSH (It will be automatically set as SSH)

Step 3:

Save the session if needed (Optional setting)

Step 4:

Click “Open.”

ssh login vps windows

Step 5: Once you click Open, you will now be asked for a user name and password.

The first time, you will be notified and asked to accept the server’s key

For generating and managing SSH Keys, you can use PuTTYgen (Installed with PuTTY software automatically)

ssh vps mac

Once you have followed all these 5 steps, you are ready to manage and control your VPS using SSH in Windows even if you’re using the older versions of Windows.

How to access VPS hosting using SSH on MacOS

Now that we have understood accessing VPS using SSH in Windows, let us understand the same but with a different operating system, which is macOS.

Accessing VPS through SSH is easy in macOS due to its Unix-based solution. This means SSH access is a built-in feature via the Terminal app. You don’t need any other applications to run the SSH; instead, just do it in 3 steps. Let’s go through these steps in detail

Step 1: Open Terminal

  • The first thing you need to do is click on the Command + Space button and type Terminal.
  • Or additionally, to access the terminal, you can go to applications and then utilities.

Whatever way you like, the first step is to open the Terminal in your macOS.

Step 2: Connect via SSH

Once the terminal is opened, you need to connect with SSH by entering the right username and IP address in the following structure:

Format: username@your_server_ip

Eg: root@192.168.1.100 

This will help you establish your computer connection with SSH, and finally you will log in to your VPS hosting management in step 3

Step 3: Accept the server fingerprint and enter the password

If you log in for the first time, it will notify you for security purposes; just accept it and type your password to enter into your virtual private server. Once you’re connected, now you can run any command for your VPS and enjoy the server management securely.

How to access VPS hosting using SSH on Linux

Accessing a VPS or any other server hosting in a Linux operating system is one of the easiest processes, but only if you have a basic idea of Linux operations and how to give commands and understand the system.

It is easy because Linux is based on a terminal or command-line interface and SSH is a native command in the Linux OS. So, here are the easiest step-by-step process to access your VPS using SSH in any version of Linux Operating system

Step 1: Open Terminal

Click Ctrl + Alt + T to access the terminal option in your Linux OS or go to the application menu to access the terminal easily.

Step 2: Use the SSH Command

Once you open the terminal in your Linux system, give the SSH command as described earlier in both Windows and macOS.

Format: username@your_server_ip

Eg: root@192.168.1.100

Step 3: Enter your password.

Step 2 will lead you to the interface for login using a password. Here you will just type your password and enter into your VPS management.

Finally, we have covered all the major ways to access VPS using SSH for security in three major operating systems: Windows, macOS, and Linux.

Advance security measures with SSH key

Using a strong password that can only be opened by you is a great way to secure your root access in SSH; however, an SSH key is something that makes your server access even more secure and harder than a password.

Let us first understand what an SSH key and how does it works, and then we will also share you the step-by-step guide on using these SSH keys

An SSH key pair is an authentication way to ensure the security and right access of the hosting without needing a password with more enhanced security. It works in the following way

  1. First, users generates two types of key pairs using a tool like ssh-keygen
  • Private Key: This key is kep private to the client machine security and secretly, which can’t be access by others because it is furthermore protected by passphrase (it is like a Password to open the Private key so that even if hackers find the private key files, they won’t be able to access it due to extra layer of passphrase security)
  • Public Key: This is a key that can be freely shared and can be copied to the remote server where the user wishes to access their hosting.

2. Public key are deployed

The public key is copied to the remote server and typically lives in a file named authorized_keys within the user’s home directory. This file lists all the authorized keys that are available to access the remote server.

      3. The actual SSH Key authentication process

  • When you try to connect with your server using SSH, the SSH client initiates the connection by sending the key pair ID to the server.
  • The server then checks its authorised_keys file for a public key with a matching ID.
  • If a match is found, the server generates and sends a random challenge message but encrypts it using the user’s public key, which was retrieved from the authorized file.
  • Once the user recieve this challenge message, they decrypt it using the corresponding private key stored on the local system
  • Now the SSH client matches the decrypted message with a session ID and calculates and ensures the same hash value and finally, if everything is okay, users get the access.

Setting up SSH Key Authentication (Advanced but highly secure)

As we understood the security and convenient feature of SSH key authentication, let us also go through the process of setting up for this SSH key instead of password-based access.

Step 1: Generate SSH Key pair

To generate the SSH key pair, open your terminal in any operating system you use (Windows/Linux/MacOS) and type ssh-keygen, then enter. You will now be guided through the process by command line.

The command line will ask you to choose and save the file location. By default it is set and if you don’t have any issue, keep it as it is. Additionally, you can create a passphrase here to secure your private key even more.

Step 2: Copy Public key to VPS

You can copy the public key to VPS by using this command line:

  • ssh-copy-id username@your_server_ip

However, if ssh-copy-id is not available, you might have to upload it manually. To do this manually, enter

  • cat ~/.ssh/id_rsa.pub

It will copy all the public keys, and then you can paste them into the ~/.ssh/authorized_keys file.

Step 3: Disable Password authentication

Although you are all set in step 2 itself, for better convenience, you can disable the password authentication. To disable it, you can simply write this in command line

  • sudo nano /etc/ssh/sshd_config

It will allow you to edit the text file on your server as a root user. After writing this prompt, as you click on enter, it will open the file. In this file, scroll and look for

#PasswordAuthentication yes

And changed it into this:

PasswordAuthentication no

You can see, we have simply removed the # and changed the word “yes” into “no.” You are now done. Click Ctrl + O to save and then Ctrl + X to exit Nano.

Once done, restart your SSH service with this command line :

sudo systemctl restart sshd

Conclusion

As we went through the step-by-step guide on accessing VPS using SSH in three different operating systems, it should now be clear that the core process remains the same across platforms: opening the terminal, entering the SSH command, and providing the password to access your VPS hosting management. Whether you’re managing a VPS or a low cost dedicated server India businesses rely on, the SSH access method stays consistent. This is especially useful for those using an India cheap dedicated server, ensuring secure and efficient server control from any OS.