I have generated a pair of keys on my windows local machine.
I have a folder c:/users/me/.ssh containing :
- the private key
- the public key
- the known_hosts file
I have uploaded the public key to my github profile.
When I open a powershell terminal and run any git command to interact with my repository, like :
git fetch my_repo_name
everything is working well.
The problem is that, I do not want to use the default private key located in the default .ssh folder, and I want to be able to specify my private key, but when I run the following command :
ssh-agent $(ssh-add C:/Users/Me/Pictures/id_rsa; git fetch my_repo_name)
I get the following error :
Identity added: C:/Users/Me/Pictures/id_rsa (C:/Users/Me/Pictures/id_rsa)
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
ps : the pictures folder is just used for the example, the point is that I want to be able to use a specific located private ssh key other than the default one.