windowsgitsshssh-keygen

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@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

Any ideas how to solve this problem?


Solution

  • 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.