OpenSSH is a connectivity tool that allows secure communication between client and server. The traffic is encrypted to discourage eavesdropping, connection hijacking, MITM attack, and other attacks.
In today’s guide, we will show you how to install OpenSSH server on an ubuntu machine. The installation will take place using the terminal with the help of a few easy-to-follow commands.
Let’s get started!
Following are the steps involved in installing OpenSSH server in Ubuntu:
To install OpenSSH server, issue the following command:
sudo apt-get install openssh-server
In this step, we will enable SSH to allow log in from remote machines. It can be done by running the following command:
sudo systemctl enable ssh
Now that we have enabled the service, let’s start it. To do that, run this command:
sudo systemctl start ssh
Now we will check whether we can access the server via ssh from a remote machine or not. To do that, log in to the system using your username and the IP address of the server machine.
ssh tom@10.254.153.43
We are using OpenPOWER based system known as Talos II from Raptor computing systems. Since it does not come with SSH server installed on it, this is how we will log in to bmc server to get access to the serial console.
ssh root@power9-bmc
To get access to the Ubuntu server console, run the obmc-console-client by executing this command:
# obmc-console-client
Firstly, update the system. To do that, execute the following command:
sudo apt update
After updating, we will upgrade the system. Run the following command to do that:
sudo apt upgrade
In this step, we will install the openssh-server package by issuing the following command:
sudo apt install openssh-server
Let’s verify whether the ssh service is running fine or not. Run this command to do that:
sudo systemctl status ssh
Now, let’s run the SSH service. First, enable it by running the following command:
sudo systemctl enable ssh
Once the service is enabled, start the service by issuing the following command:
sudo systemctl start ssh
We also need to allow SSH service through firewall. To do that, we will configure ufw, the firewall present in Ubuntu.
To allow SSH on ufw, run this command:
sudo ufw allow ssh
Next, we will enable SSH. It can be done by running the following command:
sudo ufw enable
Now check the status of the ufw firewall by running the following command:
sudo ufw status
You can now log in OpenSSH server from a desktop machine using SSH. It can be done this way:
ssh tom@10.254.153.43
ssh tom@power9
To allow password less login, you can copy and install the public key using ssh-copy-id command like this:
ssh-copy-id tom@power9
That’s all folks!
In this tutorial, we had a thorough look at how to install OpenSSH server on Ubuntu 20.04. We also saw how we can configure it for remote access and how to allow SSH service through Ubuntu’s firewall.
I hope you had a great learning time here.
2024 was the GenAI year. With new and more performant LLMs and a higher number…
Canonical’s Kubernetes LTS (Long Term Support) will support FedRAMP compliance and receive at least 12…
Welcome to the Ubuntu Weekly Newsletter, Issue 878 for the week of February 2 –…
At Canonical, we firmly believe that delivering an outstanding, customer-centric support experience is impossible without…
I want to share how to install osTicket v1.14 for Ubuntu 20.04 server. osTicket written…
Now I want to share how to install WordPress on ubuntu 20.04 server. WordPress is…