gpt4 book ai didi

git - Mac OS,使用 Git : “no such file” 生成 SSH key 时出错

转载 作者:太空狗 更新时间:2023-10-29 14:35:52 24 4
gpt4 key购买 nike

我想使用 GitHub 和多个帐户。我正在关注 this tutorial ,我需要为我们的第二个 GitHub 帐户生成一个唯一的 SSH key 并遇到一个问题:

Saving key "~/.ssh/id_rsa_nettuts" failed: No such file or directory

有一个非常相似answer , 而答案都是窗口,不起作用。

代码如下:

$ ls                 
id_rsa id_rsa.pub id_rsa_nettuts known_hosts
$ ssh-keygen -t rsa -C "houReal@gmail.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/hou/.ssh/id_rsa): ~/.ssh/id_rsa_nettuts
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Saving key "~/.ssh/id_rsa_nettuts" failed: No such file or directory
$

非常感谢。

最佳答案

希望你在 .ssh 目录中。当您输入 key 名称时,只需输入文件名而不是路径。例如:

ssh-keygen -t rsa -C "houReal@gmail.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/hp/.ssh/id_rsa): id_rsa_netus
Enter passphrase (empty for no passphrase):
Enter same passphrase again:

关于git - Mac OS,使用 Git : “no such file” 生成 SSH key 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47805504/

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