当.ssh 下出现多对公私钥对的时候,默认使用的哪个一个?

2015-03-12 14:32:30 +08:00
 dingyaguang117

在做免密码登陆,以及Git的时候怎么选

2254 次点击
所在节点    问与答
5 条回复
ryd994
2015-03-12 14:37:44 +08:00
乖乖写config
默认不应该是id_rsa么
155
2015-03-12 14:38:10 +08:00
默认是~/.ssh/id_dsa和~/.ssh/id_rsa, 可以通过~/.ssh/config指定.
hisway
2015-03-12 16:21:53 +08:00
# vi ~/ssh/sshd_config
AuthorizedKeysFile .ssh/authorized_keys
#验证文件路径
FifiLyu
2015-03-12 17:53:15 +08:00
cat ~/.ssh/config

# 未指定Host的私钥必须在顶部
IdentityFile ~/.ssh/111111111111.key
IdentityFile ~/.ssh/222222222222.key


Host git.oschina.net
IdentityFile ~/.ssh/git.oschina.net.3333333.key

Host github.com
IdentityFile ~/.ssh/github.com.444444444.key
julyclyde
2015-03-13 10:25:00 +08:00
@hisway 你说的那是sshd端

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/176358

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX