Skip to content

Techeons

Imagine | Explore | Innovate

Menu
  • Home
Menu

How to setup OpenSSH server on Ubuntu

Posted on September 29, 2024

OpenSSH (Open Secure Shell) is a free and open-source suite of security-related network connectivity tools. It provides secure access to remote systems, ensuring encrypted data transfer and authentication.

Key Features:

  1. Secure Remote Access: OpenSSH enables secure remote login, file transfer, and port forwarding.
  2. Encryption: Uses cryptographic techniques (e.g., AES, RSA, ECDSA) to protect data.
  3. Authentication: Supports password, public key, and Kerberos authentication.
  4. Secure File Transfer: Includes SFTP (Secure File Transfer Protocol) and SCP (Secure Copy) for secure file transfers.

Components:

  1. ssh: Remote login client.
  2. sshd: Remote login server.
  3. scp: Secure file copy client.
  4. sftp: Secure file transfer client.
  5. ssh-keygen: Tool for generating public/private key pairs.

Benefits:

  1. Security: Protects against eavesdropping, tampering, and man-in-the-middle attacks.
  2. Flexibility: Supports various authentication methods and encryption algorithms.
  3. Cross-platform: Available on multiple operating systems (Linux, macOS, Windows).

Common Use Cases:

  1. Remote System Administration
  2. File Transfer
  3. Secure Tunnels (Port Forwarding)

Installation

Note:
Ubuntu Server should already have OpenSSH server pre-installed.
Ubuntu Desktop may not have OpenSSH server pre-installed.

1) Install the package

sudo apt update && sudo apt upgrade
sudo apt install openssh-server

2) Start the SSH Server

sudo systemctl enable --now ssh

3) Check the status

sudo systemctl status ssh

4) Configure the firewall

Check this article for how to protect your OpenSSH server: 
Protect your OpenSSH server on Ubuntu using UFW

5) Connect to the server

Default SSH Port is 22.

ssh <username>@<ip-address>

OR use a tool like PuTTY

Download from: https://putty.org/

6) If you want to change the port number (Optional)

Create the backup of the original settings:

sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.original

Open the config file:

sudo nano /etc/ssh/sshd_config

Change the port number:

Port 32501
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

Restart the SSH service:

sudo systemctl restart ssh

Connect to the server:

ssh -p <port-number> <username>@<ip-address>

Useful links:

  • https://ubuntu.com/server/docs/openssh-server
Share on Social Media
x facebook pinterest linkedin tumblr reddit emailwhatsapptelegrammastodon

Leave a Reply Cancel reply

You must be logged in to post a comment.

Recent Posts

  • Nginx: How to increase timeout for Nginx
  • Cheat Sheet: Essential Git Commands
  • Setting a default shell in Linux
  • Setting up Composer on Linux
  • Switch easily between Python versions on a Mac using pyenv

Tags

ai alerting aws b2 backblaze certificate cheatsheet cloud commands data-science datalake devops dns docker dremio git gitlab infra jenkins kubernetes linux metabase minikube minio monitoring mount mysql nginx nodejs notebooks openssh php python scala secrets spark ssh ssl ubuntu ufw usb web dev tools windows xampp zeppelin

©2026 Techeons | Design: Newspaperly WordPress Theme