How to Connect to a Remote Server Using SSH

How to Connect to a Remote Server Using SSH

SSH (Secure Shell) is a protocol that allows you to securely connect to a remote computer or server over a network. It is commonly used by developers, system administrators, and IT professionals to manage servers, transfer files, and execute commands remotely.

 

Prerequisites

Before you start, make sure you have:

SSH enabled on the remote server or device.

The IP address or domain name of the remote server.

A username and password (or SSH key) for authentication.

An SSH client:

Windows: Built-in PowerShell/Command Prompt (or third-party like PuTTY)

Mac/Linux: Terminal app (SSH is built-in)

 

Step 1: Get the Server Details

You’ll need:

Server address (e.g., 192.168.1.100 or example.com)

Username (e.g., root, admin, ubuntu)

Password or private key file if using key-based authentication.

🔧 Step 2: Connect from Your Local Computer
🖥️ On Windows (PowerShell or CMD)

Press Win + R, type powershell (or cmd), and hit Enter.

Use the following command:

ssh username@server_ip

Example:

ssh root@192.168.1.100

If this is your first time connecting, you’ll be asked to trust the server’s fingerprint — type yes.

Enter the password when prompted.

 

On Mac or Linux (Terminal)

Open the Terminal.

Use the same command as above:

ssh username@server_ip

Enter the password or use your SSH key for authentication.

 

Connecting with an SSH Key (More Secure)

If your server uses SSH keys:

ssh -i /path/to/private_key username@server_ip

Example:

ssh -i ~/.ssh/id_rsa ubuntu@203.0.113.10

 

Using SSH Apps on Mobile

Download Termius or JuiceSSH from the App Store/Google Play.

Add a new host with:

Hostname/IP

Username

Password or SSH key

Tap to connect.

 

Security Tips

Disable root login and use non-default usernames for better security.

Use SSH keys instead of passwords when possible.

Keep your server updated to patch security vulnerabilities.

Change the default SSH port (22) to reduce automated attacks.