Passwordless Login for Linux Machines

Sep 19, 2024 · 1 min read · 98 Words · -Views -Comments · Programming
Linux SSH 🇨🇳 阅读中文版
Read with AI

Choose an AI assistant

ChatGPT Open in a new tab with the article link and prompt
Claude Copy the prompt, then open Claude

Open Claude
Trouble reading the article?

If the prompt is missing, copy the full prompt below into your AI assistant. If the AI cannot read the article, paste the visible passage you want to discuss and add your question.

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.

Authors
Developer, digital product enthusiast, tinkerer, sharer, open source lover