以前遇到过一个问题,在用有些 Linux 发行版时,用 ssh-keygen 产生好了密钥对并上传到了目标服务器,但每次登录都要重新输入。
这与 ssh-agent 有关,看如下 man ssh-agent 的输出:
ssh-agent is a program to hold private keys used for public key authentication (RSA, DSA). The idea is
that ssh-agent is started in the beginning of an X-session or a login session, and all other windows or
programs are started as clients to the ssh-agent program. Through use of environment variables the agent
can be located and automatically used for authentication when logging in to other machines using ssh(1).
时间: 2024-10-03 08:41:35