16

我使用的是 Ubuntu 12.04,每次重新启动机器时,ssh-add 保存的密钥身份都消失了。

~$ ssh-add -l
The agent has no identities.

我已经在我的 .ssh/config 文件中添加了“IdentityFile”,如下面的帖子所示,但它不起作用。

在 Ubuntu 上使用 ssh-add 永久添加私钥

我的 .ssh/config 文件如下所示:

Host github-user-1
    HostName github.com
    IdentityFile ~/.ssh/id_rsa.git.user-1
    User git
    IdentitiesOnly yes

Host github-user-2
    HostName github.com
    IdentityFile ~/.ssh/id_rsa.git.user-2
    User git
    IdentitiesOnly yes
4

0 回答 0