Table of Contents
A secure shell (ssh) is basically a cryptographic network protocol intended for a secure connection between a server and a client.
Are you looking to enable or install an open ssh server on your Ubuntu desktop or a minimal Ubuntu server?
Note that an openssh daemon or server is the daemon program for ssh client and it is an open source ssh server. The ssh replaces the unsecure rlogin and rsh, providing secure and encrypted communications between 2 untrusted hosts via an unsecure network like the Internet.
While the sshd is not readily available for the said versions of Ubuntu, you may mimic the following steps.
Installing the SSH server in Ubuntu
- Open the terminal application on your Ubuntu desktop
- Use the BMC or KVM or IPMI tool for the remote Ubuntu server in order to get console access
- Then, type ‘sudo apt-get install openssh-server’
- Type ‘sudo systemctl enable ssh’ to enable the ssh service
- Type ‘sudo systemctl start ssh’ to start the ssh service
- Log into the system by typing ‘ssh [email protected]’ to test the result
You have to log in as a user with sudo privileges to continue. But since the ssh server is not installed by default, you can enable ssh or install it on your Ubuntu system.
Open the terminal
You can either use the ‘ctrl-Alt-T’ keyboard shortcut or click the terminal icon and install the ‘openssh-server’ package. By doing so, you have to type ‘$ sudo apt update’ and ‘$ sudo apt install openssh-server’.
You have to enter the password and enter ‘Y’ to continue the installation process.
Verify the installation
After the installation, the ssh service automatically starts. You can verify that it is successful and that the ssh service is running by typing the command ‘$ sudo systemctl status ssh’. This will print the status of the ssh server.
It will look something like this ‘Active: active (running)’. You can press ‘q’ to return to the command line prompt.
Open ssh port
UFW is the firewall configuration tool of Ubuntu and it is enabled on your system. So, make sure that the ssh port is open by typing ‘$ sudo ufw allow ssh’. After the installation, ssh should be running on your system.
This will enable you to connect to it through ssh from any remote machine. Note that Mac OS and Linux systems have default ssh clients installed. When connecting from a Windows machine, you can use an ssh client like PuTTY.
Connecting to SSH via LAN
It is possible to connect an Ubuntu machine via LAN. Just enter the command ‘$ ssh [email protected]_address’. In this case, you only need to input the username with the actual user name, and the actual IP address of the Ubuntu machine where the ssh is installed.
You can type the IP command ‘$ ip a’ if you don’t know the IP address of the Ubuntu machine you are using. You will then be prompted if you want to continue. If you do so, you must enter the password. If the password is correct, you will be logged into the Ubuntu machine.