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.
Here at LinuxAPT, we shall look into how to install OpenSSH server on an ubuntu machine.
1. Install OpenSSH Server
Run the following command to install OpenSSH server:
$ sudo apt-get install openssh-server
2. Enable SSH
Here, you will enable SSH to allow log in from remote machines by running the following command:
$ sudo systemctl enable ssh
3. Start SSH
Now start the ssh service by running the below command:
$ sudo systemctl start ssh
4. Test SSH Login
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 user@10.254.153.40
1. SSH to remote server using bmc/kvm/ipmi over IP
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
2. Run obmc console
To get access to the Ubuntu server console, run the obmc-console-client by executing this command:
# obmc-console-client
1. Perform System Update and Upgrade
To begin, update the system with the below command:
$ sudo apt update
After updating, upgrade the system by running the below command:
$ sudo apt upgrade
2. Install sshd server on Ubuntu
Here, we will install the openssh-server package by issuing the following command:
$ sudo apt install openssh-server
3. Check the status of the service
To verify whether the ssh service is running fine or not, simply Run the below command:
$ sudo systemctl status ssh
4. Enable and start SSH
Now, run the SSH service by first enabling it with the following command:
$ sudo systemctl enable ssh
Then 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.
1. Allow SSH
To allow SSH on ufw, run this command:
$ sudo ufw allow ssh
2. Enable SSH
Next, we will enable SSH by running the following command:
$ sudo ufw enable
3. Check firewall status
Now check the status of the ufw firewall by running the following command:
$ sudo ufw status
1. SSH to the OpenSSH server
You can now log in OpenSSH server from a desktop machine using SSH:
$ ssh user@10.254.153.40
$ ssh user@power9
2. Enable password less access
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
This article covers how to install OpenSSH server on Ubuntu 20.04. In fact, SSH comes as an evolution to the Telnet protocol : as its name describes it, SSH is secure and encrypts data that is transmitted over the network.
As a power user, you may want to onboard new machines with SSH servers in order to connect to them later on.