Windows下SSH配置多账号

C:\Users\Administrator\.ssh 目录下新建config文件

config文件内容如下

配置了两个账号,举例如下

bash 复制代码
# github
Host github.com
HostName github.com
IdentityFile ~/.ssh/github_id_rsa
PreferredAuthentications publickey

# gitee
Host gitee.com
HostName gitee.com
IdentityFile ~/.ssh/id_rsa
PreferredAuthentications publickey