Learn How to Install and Setup SSH Server on Ubuntu Linux
In this tutorial we are going to learn how to install and configure ssh server on Ubuntu Server or Desktop Operating System.
For this tutorial I am using Ubuntu 16.04, But you can use the following guide to setup ssh server on any previous Ubuntu version.
Install Openssh Server on Ubuntu
The SSH Server for Ubuntu is provided by the openssh-server package. We can install openssh-server package in Ubuntu 16.04, using the apt-get install command.
Open the Ubuntu terminal and execute,
sudo apt-get update
sudo apt-get install openssh-server
This will install the SSH Server on Ubuntu Server.
Start SSH Server on Ubuntu
To start the SSH Server on Ubuntu 16.04, we use the systemctl command.
sudo systemctl start ssh.service
sudo systemctl enable ssh.service
In Ubuntu 14.04 use service command to start Ubuntu ssh service.
sudo service ssh start
Enable ssh root login in Ubuntu
By default SSH Server in Ubuntu do not allow to connect to the server using the root username. In order to allow root SSH Login we need to change PermitRootLogin to yes in the /etc/ssh/sshd_config file.
First, Open the /etc/ssh/sshd_config file.
sudo vim /etc/ssh/sshd_config
Then locate the line PermitRootLogin and change its value to yes.
PermitRootLogin yes
Then, Save the SSH Configuration file and restart the Ubuntu SSH Server.
sudo systemctl restart ssh.service
Or
sudo service ssh restart
Now you can login to the Ubuntu SSH Server using the root user Account.
Summary - Setup SSH Server on Ubuntu
In this tutorial we learned how to install ssh server on Ubuntu Linux.
- SSH Server for Ubuntu provides by the openssh-server package.
- By default Root Login to the SSH Server is disabled in Ubuntu Linux.
- To enable Ubuntu root SSH login, we need to set PermitRootLogin yes in the /etc/ssh/sshd_config file.