How to Connect via SSH

SSH (Secure Shell) is the standard method for remotely accessing and managing Linux servers. It provides an encrypted connection to your server’s terminal.

Connecting from Windows

Windows 10 and later include a built-in SSH client accessible from the Command Prompt or PowerShell. Alternatively, you can use a dedicated SSH client like PuTTY.

Using the Built-in Client

Open Command Prompt or PowerShell and type: ssh root@your-server-ip. Press Enter, accept the host key fingerprint if prompted (first connection only), and enter your password when asked. You are now connected to your server.

Using PuTTY

Step 1: Download PuTTY

Download PuTTY from its official website and install it.

Step 2: Enter Connection Details

Open PuTTY, enter your server’s IP address in the Host Name field, ensure the port is set to 22, and the connection type is SSH.

Step 3: Connect

Click Open. Accept the host key if prompted, then log in with your username and password.

Connecting from macOS / Linux

macOS and Linux have SSH built into the terminal. Open your terminal application and type: ssh root@your-server-ip. Enter your password when prompted.

Using SSH Keys (Recommended)

SSH keys are a more secure alternative to password-based authentication. They work by generating a pair of cryptographic keys - a private key that stays on your computer and a public key that is placed on the server. To set this up, generate a key pair using ssh-keygen on your local machine, copy the public key to your server using ssh-copy-id root@your-server-ip, and then disable password authentication in the SSH configuration to fully secure your server.

Tip: Once you have SSH key authentication working, disable password-based login by editing /etc/ssh/sshd_config and setting PasswordAuthentication to no. This dramatically reduces the risk of brute-force attacks.

 

Was this article helpful?