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.

Share.

2 Comments

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

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

Leave A Reply

Exit mobile version