Set it up according to the normal procedure ssh in the future , But it still shows Permission denied (publickey), At this time, you need to add a configuration specification .
<>1. First, check whether the previous public key is retained in the keychain .
mac lower , Please at “keychain” Search in .
If there are any previously reserved , Please delete it , Otherwise, it will be filled automatically .
<>2. Follow the steps to create sshkey, Then join ssh-agent：
ssh-agent bash // open sshagent ssh-add -l // View joined ssh-add -D // Delete all joined id_rsa
ssh-add id_rsa // join sshagent in
<>3. Add configuration
stay "C:\Users\ Your computer's user name \.ssh" Create a new one in the directory config file , No suffix .
stay ~/.ssh/ Under the implementation
touch config open config
windows lower config Content of configuration ：
be careful ：id_rsa The path is a double slash
Host gitee.com HostName gitee.com user git IdentityFile
C:\\Users\\ Your computer's user name \\.ssh\\id_rsa
mac lower config Content of configuration ：
Host gitee.com HostName gitee.com user git IdentityFile ~/.ssh/id_rsa
The two main items of this configuration are HostName and IdentityFile, Corresponding separately git Domain name and id_rsa Local path of .
in addition ： This configuration can also control more than one computer git account .
<>4. Test it
ssh -T firstname.lastname@example.org