Passwordless Authentication in linux

Hello Readers, today the topic is how to setup passwordless authentication. for that first we need to understand what is passwordless authentication and what is the difference between passwordless authentication and MFA. you will learn everything in this blog. So, Let’s check it out.

passwordless authentication
  • It is a kind of authentication method in which a user can login without a password. User has to complete the authentication process by providing secure proof through a register device.
  • In this method public key and private key would be used to authenticate.
  • Public key: it is a long random stream of bits which is derivative of a private key.
  • Private key: long random stream of bits, kept secret never leaves the client.
  • You can generate the public key from the private key but cannot do the opposite thing.
  • In passwordless authentication, the public key is provided to servers,websites etc. and the private key is in the user’s device.

How is MFA different from passwordless authentication?

  • MFA is an added layer of security on password based authentication.

Steps for passwordless authentication:

Step 1: create ssh keypair from following command:

Ssh -keygen -t rsa

Here -t means type

  • Enter the location where you want to store it. Enter the path.
  • Verify you have successfully created a key pair.

Ls ~/*

Step 2: upload public key to remote server

  • To enable passwordless access you have to upload a copy of the public key to the server under the .ssh directory as a file name ‘authorized_keys’.

Ssh-copy-id [remote_username]@[server ip add]

Step 3: Login without password

Ssh [remote_username]@[server ip add]

Scenario of passwordless authentication:


This client has both public and private keys. And the server will have only a public key.

  1. Client ask server to connect
  2. Server acknowledges with encrypted message using public key.
  3. Client decrypts the message using a private key.

Connection established.

This is how it works.




2X AWS Certified, DevOps Engineer, Microsoft Learn Student Ambassadors (Alpha)

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

GDPR — Where are we now?

What is a Computer Worm?

What is a Computer Worm?

CC: Pen Testing WriteUp — TryHackMe

Building a Better Vulnerability Management Program

What’s Lateral Movement?

Evin McMullen, Co-Founder And CEO At

Why are phishing attacks a bigger threat in COVID-19 times?

OSCP: Never Quit!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Krupa Bhimani

Krupa Bhimani

2X AWS Certified, DevOps Engineer, Microsoft Learn Student Ambassadors (Alpha)

More from Medium

How to start, stop and pull docker image in linux?

Linux Series Part 2: File management

6 Steps to Change Jenkins Home in Linux

LVM in Linux — Create and Extend a Logical Volume