Passwordless Login for Linux Machines

For security reasons, passwordless login is generally implemented using public-private key pairs. Here, I’ll mark down the configuration method.

  1. Log into the client machine and create a public-private key pair if you don’t already have one.

    The public and private keys are stored in the ~/.ssh directory.

  2. Log into the target server and open the ~/.ssh/authorized_keys file.

    The authorized_keys file records the list of public keys authorized for login.

  3. Copy the public key from the client machine into this file and save it.

  4. Try SSH login to the target machine again, and you’ll find no password is required.