SSH配置-相同的主机,但密钥和用户名不同
我已经设置了两个GitHub帐户,但是我无法获取ssh密钥来正常工作。我尝试了各种配置。 Host github_username1 HostName github.com IdentityFile ~/.ssh/rsa_1 User username1 Host github_username2 HostName github.com IdentityFile ~/.ssh/rsa_2 User username2 git push: Permission denied (publickey). fatal: The remote end hung up unexpectedly 适用于username1: Host github.com HostName github.com IdentityFile ~/.ssh/rsa_1 User username1 Host github.com HostName github.com IdentityFile ~/.ssh/rsa_2 User username2 git push 在username2的仓库中: ERROR: …