Linux System Administration

0 of 77 lessons complete (0%)

Introduction to Linux System Administration

Installation of SSH & Curl: Your Connectivity Toolkit

You don’t have access to this lesson

Please register or sign in to access the course content.

SSH Server & Curl Guide

Mastering SSH & Curl: Your Connectivity Toolkit

A Step-by-Step Guide to Installation and Remote Access

Why SSH and Curl?

SSH (Secure Shell) is a cryptographic network protocol for operating network services securely over an unsecured network. It’s primarily used for remote command-line login and executing commands on a remote server. Think of it as a secure tunnel to your server.

Curl is a command-line tool and library for transferring data with URLs. It’s incredibly versatile and widely used for making HTTP requests, downloading files, testing APIs, and much more. It’s your go-to tool for interacting with web services directly from the terminal.

This guide will walk you through setting up an SSH server and installing `curl` on an Ubuntu system, and then demonstrate how to connect to your server from both Windows and Linux.

Prerequisites

  • An Ubuntu server instance (e.g., Ubuntu 24.04 LTS).
  • A user account with `sudo` privileges on the server.
  • Access to the server’s terminal (via direct console or a cloud provider’s console).
  • An active internet connection on the server.

Server Setup: SSH & Curl Installation (on Ubuntu Server)

1. Update Your System

Always start by updating your system’s package list.

sudo apt update
sudo apt upgrade -y

2. Install OpenSSH Server

The OpenSSH server package is usually available in the default repositories.

sudo apt install openssh-server -y

Once installed, the SSH service should start automatically. You can verify its status:

sudo systemctl status ssh

Look for “active (running)” in the output.

3. Configure Firewall for SSH (UFW)

If you’re using UFW (Uncomplicated Firewall) on Ubuntu, you need to allow SSH traffic.

sudo ufw allow ssh     # Allows traffic on port 22 (default SSH port)
sudo ufw enable        # Enable UFW if it's not already
sudo ufw reload        # Apply changes

You can check the firewall status with `sudo ufw status`. Ensure “OpenSSH” or port 22 is allowed.

4. Install Curl

Curl is often pre-installed, but if not, you can easily install it.

sudo apt install curl -y

Verify installation by checking its version:

curl --version

Connecting to SSH from Windows

Modern versions of Windows (Windows 10 and 11) come with a built-in OpenSSH client, making connections straightforward.

Using Windows Command Prompt or PowerShell

Open your Command Prompt (`cmd`) or PowerShell.

ssh username@YOUR_SERVER_IP_OR_DOMAIN

Replace `username` with your user account on the Ubuntu server and `YOUR_SERVER_IP_OR_DOMAIN` with your server’s IP address or domain name.

The first time you connect, you’ll be asked to confirm the server’s authenticity. Type `yes` and press Enter. Then, you’ll be prompted for your password.

Alternative: PuTTY (for older Windows or GUI preference)

If you prefer a graphical client or are on an older Windows version, PuTTY is a popular free SSH client.

  1. Download and install PuTTY from its official website.
  2. Open PuTTY.
  3. Enter your server’s IP address or domain name in the “Host Name (or IP address)” field.
  4. Ensure the “Port” is 22 and “Connection type” is SSH.
  5. Click “Open”.
  6. A terminal window will appear. Enter your `username` and `password` when prompted.

Connecting to SSH from Linux

Connecting from another Linux machine is very similar to using the built-in client on Windows, as Linux distributions typically have the OpenSSH client pre-installed.

Using the Terminal

Open your terminal.

ssh username@YOUR_SERVER_IP_OR_DOMAIN

Replace `username` with your user account on the Ubuntu server and `YOUR_SERVER_IP_OR_DOMAIN` with your server’s IP address or domain name.

The first time you connect, you’ll be asked to confirm the server’s authenticity. Type `yes` and press Enter. Then, you’ll be prompted for your password.

Security Best Practices (Important!)

  • Use Strong Passwords: Always use complex and unique passwords for your server accounts.
  • SSH Key Authentication: For enhanced security, consider setting up SSH key-based authentication instead of passwords. This is more secure and convenient.
  • Disable Root Login: It’s a good practice to disable direct SSH login for the `root` user and instead use a regular user with `sudo` privileges.
  • Change Default SSH Port: For an extra layer of obscurity, consider changing the default SSH port (22) to a non-standard port.

You’ve now learned how to install SSH and Curl, and how to connect to your server from different operating systems. These tools are fundamental for server administration and web development!