Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Network Services»SSH»A Guide to Install or Update OpenSSH Server on Debian.

    A Guide to Install or Update OpenSSH Server on Debian.

    By RahulAugust 4, 20222 Mins Read

    OpenSSH is the most popular ssh server for Linux-based systems. It is used to connect the ssh server securely from remote systems having ssh clients. This article will help you install the OpenSSH server on Debian Linux systems.

    Advertisement

    OpenSSH is the most widely used ssh server for Linux-based systems. This article describes how to install the OpenSSH server on Debian Linux systems. OpenSSH is used to connect securely to the server from remote ssh client systems.

    Step 1 – Installing OpenSSH Server on Debian

    OpenSSH server can be installed on Debian systems using the default Apt repositories. You can update Apt-cache and install OpenSSH using the following commands. If OpenSSH is already installed, it will be upgraded to the latest version.

    sudo apt update 
    sudo apt install openssh-server 
    

    Step 2 – Secure OpenSSH Server

    The /etc/ssh/sshd_config is the main configuration file for OpenSSH server. After successfully installing the OpenSSH server on your system, you may need to make few changes to secure your server.

    • Change Default Port – OpenSSH runs on default port 22. We recommend changing the SSH port to another port.
      Port 2222
      
    • Disable Root Login – By default root user are allowed to ssh from remote clients, For security purpose we recommend to disable direct root access. Use any non-root account for ssh and then switch ( su – ) to the root account. To do this add “PermitRootLogin no” in ssh configuration file
      PermitRootLogin no
      

    Remember to restart the OpenSSH server after making changes to the configuration files.

    For more details visit https://tecadmin.net/5-tips-to-secure-openssh-server/

    Step 3 – Manage OpenSSH Service

    Systemd is the default service manager for the latest Debian operating systems. You can manage the OpenSSH service state usign the systemctl command.

    Use one of the below commands to start, stop, or restart the OpenSSH service:

    sudo systemctl restart ssh 
    sudo systemctl start ssh 
    sudo systemctl stop ssh 
    

    To check the current status, type:

    sudo systemctl status ssh 
    

    Conclusion

    The procedure for installing or upgrading the OpenSSH server on Debian Linux is described in this tutorial. You also learn how to change the default SSH port and disable root login.

    OpenSSH openssh server SSH
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    How To Display Warning Message to Unauthorized SSH Access

    How to Set a Custom SSH Login Banner and MOTD

    How to Install and Secure OpenSSH Server on Pop!_OS

    View 2 Comments

    2 Comments

    1. Arvind Kumar on September 25, 2019 1:34 pm

      There is no information about “Update”. Why do you mention in the title when you don’t post information on something.

      Reply
      • Rahul on September 26, 2019 10:56 am

        Hi Arvind, If the older version of Openssh is already installed, then the package manager will automatically update to the latest available version.

        Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • How to List Manually Installed Packages in Ubuntu & Debian
    • 10 Bash Tricks Every Developer Should Know
    • How to Validate Email Address in JavaScript
    • Firewalld: Common Firewall Rules and Commands
    • 12 Apk Commands in Alpine Linux Package Management
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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