You can allow users to log in to remote machines using two ways:

  1. username/password
  2. ssh keys

While using ssh keys, the user generates his/her ssh keys (pair of private public keys) using ssh key-gen. Those keys are stored as:

  1. ~/.ssh/id_rsa.pub (public key) 
  2. ~/.ssh/id_rsa (private key) 

Now in order to allow that user ssh login, we can add his/her public key inside ~/.ssh/authorized_keys file.

Whenever a user tries to log in, his ‘session/activity’ is signed using his/her private key. At the remote server, the respective public key verifies the identity and if it’s matched user is allowed access.

Public Key Encryption

View 1 other answer to this question
About · Careers · Privacy · Terms · Contact · Languages · Your Ad Choices · Press ·
© Quora, Inc. 2025