Access Linux Remotely with SSH and PuTTY: A Quick Guide

By Anup Moitra

Updated on:

Accessing a Linux machine remotely is essential for managing servers, troubleshooting, and performing system administration efficiently. Secure Shell (SSH) provides secure, encrypted remote access, while PuTTY is a popular SSH client for Windows. This hands-on guide teaches you how to set up, use, and optimize SSH connections safely, whether on Linux, macOS, or Windows.

Why Use SSH for Remote Access?

SSH ensures secure, encrypted connections to your Linux system, protecting data and credentials from unauthorized access. Key benefits include:

🔒

Security

End-to-end encryption prevents eavesdropping and unauthorized access.

Efficiency

Fast, reliable remote access without overhead of GUI tools.

🌐

Remote Management

Administrate Linux servers from anywhere using an internet connection.

SSH is ideal for cloud servers, remote troubleshooting, and system administration without physical access.

Video Tutorial: SSH Remote Access

Watch this quick demonstration of SSH remote access in action:
[Embed YouTube video here]

Follow the detailed steps below to set up SSH manually and via PuTTY.

Prerequisites for SSH Remote Access

  • Linux Machine: A server or desktop running Linux.
  • SSH Server Installed: The openssh-server package must be installed and active.
  • SSH Client: For Windows, install PuTTY or use Windows built-in OpenSSH; Linux/macOS already includes SSH.

Step 1: Install SSH Server

Install and start the SSH server to allow remote connections:

sudo apt update
sudo apt install openssh-server
sudo systemctl start ssh
sudo systemctl enable ssh
Pro Tip: Use sudo systemctl status ssh to verify the server is running.

Step 2: Configure Firewall

Ensure SSH traffic is allowed through your firewall:

sudo ufw allow ssh
sudo ufw enable
sudo ufw status
Pro Tip: Always verify firewall rules to prevent accidental lockouts.

Step 3: Find Your Linux Machine’s IP Address

Identify the IP address to connect remotely:

# For local network (private IP)
ip addr show

# For public IP (internet access)
curl ifconfig.me

Note the inet field under your network interface (eth0 or wlan0).

Step 4: Connect via SSH

1

Linux/macOS Terminal

ssh username@ip_address

Replace username with your Linux user account and ip_address with the IP address of the remote machine. Confirm authenticity with yes if prompted, then enter your password.

2

Windows Using PuTTY

  1. Download PuTTY from https://www.putty.org/ and install it.
  2. Open PuTTY and enter your Linux machine’s IP address under “Host Name”.
  3. Ensure the port is set to 22 and click “Open”.
  4. Enter your username and password to log in.

Step 5: Use SSH Keys for Secure Authentication

SSH keys offer passwordless login and higher security:

# Generate a key pair
ssh-keygen -t rsa -b 4096

# Copy public key to server
ssh-copy-id username@ip_address

# Connect without password
ssh username@ip_address
Pro Tip: Protect your private key with a passphrase. Store it securely!

Troubleshooting Common SSH Issues

Connection Refused

Ensure SSH server is running: sudo systemctl start ssh

Incorrect Credentials

Double-check username and password, or reset password if needed.

Firewall Blocking SSH

Allow SSH through firewall: sudo ufw allow ssh

Conclusion

SSH is a critical tool for remote Linux management. By following this guide, you can securely access, administer, and automate tasks on your server from anywhere. Combining SSH with key-based authentication ensures both efficiency and strong security.

Leave a Comment