使用 ssh-keygen Git bash Windows 10 Enterprise 创建 ssh 密钥时权限被拒绝

Permission denied while creating ssh key using ssh-keygen Git bash Windows 10 Enterprise

我正在尝试使用 git bash ssh-keygen 创建 ssh 密钥。设置文件名和密码后 Saving key "sshKey" failed: Permission denied 出现错误。

$ ssh-keygen -t rsa -C "email@bla.com" -b 4096
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/user1/.ssh/id_rsa): sshKey
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Saving key "sshKey" failed: Permission denied

有什么解决这个问题的想法吗?

我通过在 C:/Users/currentUser 中创建 .ssh 目录解决了这个问题,然后打开 Git Bash 并将路径设置为新创建的文件夹。之后使用 ssh-keygen 生成 ssh 密钥并且没有 Permission denied error.