gpt4 book ai didi

linux - ssh-add id_rsa.pub 生成无效格式错误

转载 作者:太空宇宙 更新时间:2023-11-04 05:58:09 27 4
gpt4 key购买 nike

遵循 ssh 教程,并使用 ssh-keygen -t rsa -b 4096 -C "demo pubkey"
成功生成了 ssh key 对(公共(public)和私有(private)) ,

讲师采取的下一步是使用 eval "$(ssh-agent -s)" 在后台启动 ssh 程序。 .

然后下一条指令是使用 ssh-add ~/.ssh/id_rsa.pub 添加 ssh key .

教练命令成功运行,但当我 ssh-add <the id_rsa.pub file> 时,我说格式无效 ,但当我 ssh-add <the id_rsa file> 时成功添加.

我对此很陌生,我有 -0 知道发生了什么,有人吗?

id_rsa 文件看起来像

    -----BEGIN RSA PRIVATE KEY-----
MIIJJwIBAAKCAgEAv6f41EMnKIq4ALYczIfJczWY/KPk3nYN8NEx6Em1Ifo+KN+C
f0nNISk/jcHITFUT9dr+pHBT7j06+L6Xn5eyAfBPzFi8QQ9+AHqaMhWSaoambGL/
WC/5JecsXWkPa8VrZaE3g3ST9uknPX9Jt1AEEpoXfbbtug8PyOEtDJO7fm3t7Lch
71VZKr2b4mV3xYLScjgaTfctqfFU2oIQuGOhnBucwQ5rAe2S0O1GhL4jdzZFQWkk
02XQ268Mbkz5VK6Bw9VaYwNu8lF75KjDvgDpIlMnS1/rYxIb3gx1wBc36IK1fGVW
2ymqV47a2VL5OF+AU53bsrVvC+ya5WyrTmif3ivByAkWwni2EggjGzfSUUbdrcry
dPul4qFNrknNmYuq6WIFck46AKbNv8bHt5wz1wpg5RP1jsGTv+k6EBTnpTV4odKR
eXz805AXGSKjo6oNVBfU5kwfscEoe8UmyNwtCwcm/O5ztIKWvJqy9il6jQKMk0XR
GkDhAhq8vkB+0i+6XZ6acKvVZjRdKy9tQS8Hk5exxKIogHg0jLgZQEx50tLK1Ayv
ztfAxg7zwKpTY7ip7YzBM5cFXGZEiXfBHZp1Z0sThsIEyAn5x3FCq3j/kMZGoppw
pItjs1kfj31h6h9HC1F7YKkWLe3iICE5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LUXtgqRYt7eIgITmMXDtcZt334IjSc+5/HTpa1Q3QsQ== demo pubkey

最佳答案

ssh-agent是一种身份验证代理,用于使用非对称加密技术验证用户/计算机。私钥是“您的身份”,公钥可以用来“验证”您的身份。因此,身份验证代理(在您的情况下为 ssh-agent)应该知道私钥,而公钥将由远程服务/服务器使用。 ssh-agent 只需要知道私钥,而不需要知道公钥。

关于linux - ssh-add id_rsa.pub 生成无效格式错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45268362/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com