Installation of OpenSSH Server on Debian

Installation of OpenSSH Server on Debian 9.8

SSH stand for secure shell. SSH is a cryptographic network protocol and its listen on Standard Transmission Control Protocol (TCP) port is 22 that use to connect client computers to servers or devices remotely. The SSH protocol provide security over a unsecured network. 

OpenSSH Server is a package of Linux in our case Debian Linux 9.8 that provide a secure connectivity between client computer and server.

Install a OpenSSH Server on Debian Linux 9.8 modify the sources.list file that available in the below mention path.

/etc/apt/sources.list

The sources.list file help to locate repositories of Debian Linux operating System from internet. Use nano editor to modify the sources.list file.

nano /etc/apt/sources.list

how install openssh server on debian

Before edit the lines.

how install openssh server on debian


Edit below lines in sources.list file to install require repositories in Debian Linux.

deb-src http://ftp.us.debian.org/debian/ stretch main 
deb http://ftp.us.debian.org/debian/ stretch main 
deb http://security.debian.org/debian-security stretch/updates main 
deb-src http://security.debian.org/debian-security stretch/updates main

how install openssh server on debian

Press Control with o to write out the file.

Control+o

Press Control with x to exit from the file.

Control+x

Edit the sources.list file is enough for the installation of require repositories in Debian Linux operating system, In our case require repository mean OpenSSH Server package.

Run the below command to update Debian Linux 9.8 operating system, Because first update the Debian Linux operating system for the installation of OpenSSH Server.

apt-get update

how install openssh server on debian

To install OpenSSH Server in Debian Linux operating system run the below command.

apt-get install openssh-server

how install openssh server on debian

Press y to continue the installation process of OpenSSH Server in Debian Linux.

how install openssh server in debian

By default for security reasons root user is not allow to take SSH of Server. Login with non administrative user account that create during the installation of Debian Linux 9.8 then switch to root user to perform administrative activities. Here debian9 is non administrative user account to take Remote SSH Session through Putty, you can use any other software to take Remote SSH Session. 

how install openssh server on debian

If you want to allow root user to take Remote SSH Session of Server edit the sshd_config file that available in /etc/ssh/sshd_config. To edit the file switch to root user.

su root

how install openssh server in debian

Use cd command to locate sshd_config file.

cd /etc/ssh

how install openssh server  in debian

Use nano editor to edit sshd_config file.

nano sshd_config

how install openssh server in debian

Uncomment Port 22 that use to allow Remote SSH Session for root user.

how install openssh server on debian

Modify the Below two Lines and uncomment.

First Line
#PermitRootLogin prohibit-password
After Modify
PermitRootLogin yes
Second Line
# StrictModes yes
After Modify
StrictModes no

Before edit the lines
how install openssh server in debian

After edit the lines

how install openssh server in debian

Press Control with o to write out the file.

Control+o

Press Control with x to exit from the file.

Control+x

Restart SSH service before take Remote SSH Session from root user. Use anyone command to restart SSH service.

service sshd restart
systemctl restart sshd

how install openssh server in debian

Use root user to take Remote SSH Session by putty, you can use any other software to take Remote SSH Session.

how install openssh server in debian

Thanks for read this Article

Comments