Rafał Sokalski
Rafał Sokalski

Reputation: 2007

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

I am trying to create ssh key using git bash ssh-keygen. After setting file name and passphrases Saving key "sshKey" failed: Permission denied error appears.

$ ssh-keygen -t rsa -C "[email protected]" -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

Any ideas how to solve this problem?

Upvotes: 3

Views: 14217

Answers (1)

Rafał Sokalski
Rafał Sokalski

Reputation: 2007

I solved this problem by creating .ssh directory in C:/Users/currentUser and then open Git Bash and set path to newly created folder. After that generate ssh key using ssh-keygen and there is no Permission denied error.

Upvotes: 10

Related Questions