Passwordless Authentication using SSH
Gartner predicts that, by 2022, 60% of large and global enterprises as well as 90% of midsize enterprises will implement passwordless methods in more than half of use cases. Also Google Cloud’s director of product management Sam Srinivas explains, passwordless authentication usage will likely grow rapidly in the near future .
In this article I will walkthrough process of configuring SSH client for password less authentication
Watch on YouTube
What is Password Less Authentication
Passwordless authentication is an authentication method in which a user can log in to a computer system without the entering a password or any other knowledge-based secret.
Simple password authentication methods that require only username and password combinations are inherently vulnerable. Attackers can guess or steal credentials and gain access to sensitive information and IT systems using a variety of techniques. Also Users are forced to memorize and track a dizzying array of frequently changing passwords. Overwhelmed by password sprawl, many users take risky shortcuts like using the same password for all applications, using weak passwords, repeating passwords, or posting passwords on sticky notes.
Using SSH (Secure SHEL) key for passwordless Remote Authentication .
In this article I will show you how to setup password less login to Ubuntu machine . Same method also could be used on RHCL/Centos and Fedora.
SSH (Secure SHELL) is an open-source network protocol that is used to login to remote servers for the execution of commands and programs. It is also used to transfer files from one computer to another computer over the network using a secure copy (SCP) Protocol
Let’s start working on above setup where we have two Ubuntu Servers hosted on AWS cloud.
We need to configure password less SSH authentication so that remote user can access cloud servers without password.
Steps to be carried out on your cloud ubuntu server
Step 1 – Spin up two ubuntu servers in cloud . Make use of any existing or new key pair so that you can get remote access to these server.
Step 2. Login to ubuntu server #1 using your key pair to create a user with password.
Step 3. Create a new user with password in your ubuntu server #1
Step 4. Edit etc/ssh/sshd_config to enable users to login to this server with password.
#sudo nano /etc/ssh/sshd_config
Change no with yes in marked line and save your file
Step 5 . Restart your sshd service
#sudo systemctl restart ssh.service
Steps to be carried out on your workstation
Step 1. Create SSH key pair from within the user you want to provide password less access into remote user in cloud server.
You can simply press enter key when it ask to provide passphrase and file name to save key. Your keys will be save in ~/.ssh/id_rsa and id_rsa.pu . id_rsa is your private key and id_rsa.pub is your public key.
Step 2. Copy your public to remote ubuntu server using remote username you want access of.
Use below command being in ~/.ssh folder of your workstation and use remote ubuntu server username in the command
Step 3. Now you are ready to login to your remote ubuntu server without using password
#ssh <username>@<remote IP
And you are done…..!