【发布时间】:2021-11-10 17:27:13
【问题描述】:
我正在 gitlab 中为 2 个不同的帐户设置我的 ssh 配置。
Host gitlab.com-roulette
HostName gitlab.com
User norayr.ghukasian
IdentityFile /home/norayr_ghukasyan/.ssh/id_ed25519_roulette
Host gitlab.com-devlix
HostName gitlab.com
User norayr.ghukasyan
IdentityFile /home/norayr_ghukasyan/.ssh/id_ed25519_devlix
我收到Permission denied 错误。
对我来说奇怪的是第一个工作正常,因此我认为我的配置中有一些我不知道的小问题。我猜当用户或服务器尝试连接时,ssh 会自动将第一个配置与匹配的HostName 匹配。
如何正确设置它以适用于两个帐户?
附: Users 是不同的 - norayr.ghukasian 和 norayr.ghukasyan。
【问题讨论】:
-
奇怪的是,
User通常总是git?我对这些工作中的任何一项都感到惊讶。无论如何,这在use different accounts on a single gitlab instance 中有介绍。这能回答你的问题吗?