Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Linux Tutorials»How To Enable SSH Server on Ubuntu 22.04

    How To Enable SSH Server on Ubuntu 22.04

    By RahulApril 20, 20222 Mins ReadUpdated:April 22, 2022

    SSH (Secure Shell) is a cryptographic protocol to provide secure data transmission over insecure networks. OpenSSH is the server that implements SSH protocol to provide remote server shell access.

    Advertisement

    Today, I have created a new Ubuntu 22.04 Desktop virtual machine. After installation, I found that the SSH server is not enabled by default. So I have installed the OpenSSH server and enabled the SSH connections. This tutorial explains you to how to install and enable SSH on an Ubuntu 22.04 Linux system.

    Installing OpenSSH on Ubuntu

    You must have physical system access to complete OpenSSH server installation. Login to the Ubuntu system and open a terminal.

    1. Now, run the following commands to install the OpenSSH server on your system.
      sudo apt update 
      sudo apt install openssh-server 
      
    2. Once the packages installation finished, run the below command to check SSH service status:
      sudo systemctl status ssh 
      

      It should be active and running as below:

      Enable SSH in Ubuntu 22.04

    3. The Ubuntu systems ships with default UFW firewall, If the UFW is active, you need to allow SSH port 22 for remote users. To allow port 22 in UFW type:
      sudo ufw allow 22/tcp 
      

    You have successfully installed the OpenSSH server on Ubuntu 22.04 system.

    Connect to SSH Server

    Now, you can access Windows users can use third-party applications lie

    Linux users can use the “ssh” command-line utility to connect to a remote server using SSH.

    ssh [email protected]_host 
    

    Disable SSH Server

    The systems with physical access are less required SSH access. In that case, you can either block ssh access using the firewall or disable the SSH service on your system.

    • To block SSH access via UFW firewall, type:
      sudo ufw deny 22/tcp 
      
    • You can also completely disable the SSH service (OpenSSH) to prevent remote access.
      sudo systemctl stop --now ssh 
      sudo systemctl disable --now ssh 
      

      The above commands will stop SSH service immediately and disable the autostart of service on system bootup.

    Conclusion

    This tutorial helps you to install and enable the OpenSSH server on Ubuntu 22.04 Linux system.

    After installing you can also change the SSH port to secure system.

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    An Introduction to the “./configure” Command: Compiling Source Code in Linux

    Getting Started with Linux Command line: The Beginning

    Backing Up Your Linux System with Rsync: A Step-by-Step Guide

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Error: EACCES: permission denied, scandir (Resolved)
    • How To Install Python 3.11 on Ubuntu 22.04 / 20.04
    • How to Install Python 3.11 on Amazon Linux 2
    • An Introduction to the “./configure” Command: Compiling Source Code in Linux
    • How to Install PHP 8.x on Pop!_OS
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.