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
Before edit the lines.
Edit below lines in sources.list file to install require repositories in Debian Linux.
deb-src http://ftp.us.debian.org/debian/ stretch maindeb http://ftp.us.debian.org/debian/ stretch maindeb http://security.debian.org/debian-security stretch/updates maindeb-src http://security.debian.org/debian-security stretch/updates main
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
To install OpenSSH Server in Debian Linux operating system run the below command.
apt-get install openssh-server
Press y to continue the installation process of OpenSSH Server in Debian Linux.
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.
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
Use cd command to locate sshd_config file.
cd /etc/ssh
Use nano editor to edit sshd_config file.
nano sshd_config
Uncomment Port 22 that use to allow Remote SSH Session for root user.
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
After edit the lines
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 restartsystemctl restart sshd
Use root user to take Remote SSH Session by putty, you can use any other software to take Remote SSH Session.
Thanks for read this Article
Comments
Post a Comment