In this video we are going to learn Password less authentication in Ubuntu 22.04 LTS AWS EC2 and connect to user without Password.
Requirements
- AWS Account
- Amazon EC2 Ubuntu 22.04
- A user with the sudo privilege command
- Atleast 2 user (to connect password less)
Step #1:Create new user in Ubuntu
Lets create new user in server
sudo adduser devopshint
now navigate the devopshint user
su - devopshint

Step #2:Then give some privileged using below command
Run the below command to give privileged:
sudo visudo
go to inside this file and add this line
devopshint ALL=(ALL) NOPASSWD:ALL

Step #3:Configure ssh-config file in all nodes
We need to open this config file in both nodes and uncomment this lines
sudo nano /etc/ssh/sshd_config
Then you need to uncomment these two lines
PubkeyAuthentication yes PasswordAuthentication yes
Now we need to restart sshd service in both nodes:
sudo systemctl restart sshd
Lets check the status:
sudo systemctl status sshd
Output:

Step #4:Establish connection
Go to devopshint user in server run the below command
Login to devopshint using below command:
su - devopshint
Run the below command to connect node:
ssh ip_address ( ec2-public-ip)
Step #5:Remove password
To remove password run the below command
We need to generate ssh keygen
ssh-keygen

You need to inside .ssh:
cd .ssh
Now run the below command using private ip of your node:
ssh-copy-id devopshint@{ec2-public-ip}

Step #6:Lets connect to user without Password | Password less authentication in Ubuntu
Now lets connect to node to the server without password using below command:
ssh devopshint@ip_address

Conclusion:
We have covered Password less authentication in Ubuntu 22.04 LTS AWS EC2 and connect to user without Password.
Related Articles:
How to Install Redis on Ubuntu 18.04 and 16.04 LTS
Reference: