简体   繁体   中英

Change the .ssh key used by git on windows

I am trying to push a code to a remote repository with which one of my two accounts on github are authorized. Corresponding to the two accounts, I have two ssh keys in my .ssh folder: id_rsa and id_rsa_rahulserver

I want to use the second key instead of the first, but whenever I do a git push, I get this messageછ

Enter passphrase for key '/c/Users/rahul/.ssh/id_rsa':

So always its taking up the first key instead of second(thereby giving the not authorized error). What should I do to make it accept second key instead of first for git push?

create a file ' config ' in .ssh/ if you don't have it already and add the following

Host github.com
  IdentityFile ~/.ssh/id_rsa_rahulserver

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM