To connect to the authorized client machine, we generate the SSH keys which are unique and can connect to the host machine after entering those unique SSH keys into the client machine. So, in this blog, we will explore a method by which we can generate the SSH keys on Ubuntu.
First, we will make sure that the SSH server is installed on both the client and host machine. If it is not installed, install it first by following our dedicated installation guide.
To begin with the generation of SSH keys on Ubuntu, we will start with the client machine. First, verify whether there are keys already generated or not. To verify, use the command typed below:
In the above figure, we can see that there is no directory which means that there is no SSH keys on the client machine, so now we will generate the SSH key on the client machine using the command:
When you run the above command:
Once the key is generated, the next step is to verify the generation of SSH keys by running the command:
So, it has displayed the SSH keys file.
Now, to copy the SSH keys on the machine to which we want to connect remotely(host). For this, we should know the IP address as well as the username of that machine. In our case, the user name is “hammad”, the ip address is “10.0.2.15”:
It will ask you to enter the password of the remote(host) machine; enter the password and hit “Enter”:
The SSH keys are successfully copied to the Host machine.
Finally, we will connect with the machine, using the command:
As you can see, we are signed into the machine.
If you want to disable the identification method, then simply open the “ssh_config” file in the client machine using the nano text editor:
Find out the line “PasswordAuthentication ” and then changed the “Yes” with “no”:
Exit from the file and reload the service of ssh using the systemctl command:
The service is reloaded and status can be verified using the option of status with the systemctl command:
The SSH server is used to connect with the other machines remotely and to have a secure connection with them, we generate the SSH keys on Ubuntu 22.04. In this blog, the method of generating the SSH keys on Ubuntu has been explained.
Previously I have written about how useful public cloud storage can be when starting a…
This is Part 2 of the "Karafka to Async Journey" series. Part 1 covered WaterDrop's…
For many software teams, documentation is written after features are built and design decisions have…
With the release of the FIPS 140-3 certified cryptographic modules for Ubuntu 22.04 LTS, Canonical…
Open source libraries are repositories of code that developers can use and, depending on the…
Last year, we had the opportunity to speak at Regent’s UX Conference (Regent’s University London’s…