Mac下如何支持多个ssh-key呢?

通过ssh-config文件配置各个ssh-key,避免在mac重启后,每次手动添加ssh-key。

配置文件config如下:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13

Host    		gitee.com
HostName  		gitee.com
User            ksnowlv@163.com
PreferredAuthentications publickey
IdentityFile    ~/.ssh/ksnowlv163


Host    		10.103.40.101
HostName  		10.103.40.101
User            git
PreferredAuthentications publickey
IdentityFile    ~/.ssh/id_rsa