ssh 配置格式

pan*_*hro 3 git ssh github

我遵循了一个教程,所以我可以在同一台机器上有两个单独的 git hub 用户,我在 ssh 文件夹中创建了一个配置:

#Default GitHub
Host <span class="skimlinks-unlinked">github.com</span>
HostName <span class="skimlinks-unlinked">github.com</span>
User git
IdentityFile ~/.ssh/id_rsa
Host github-panthro
HostName <span class="skimlinks-unlinked">github.com</span>
User git
IdentityFile ~/.ssh/id_rsa_panthro
Run Code Online (Sandbox Code Playgroud)

但是现在当我尝试 ssh 时出现错误:

config line 3: garbage at end of line; "class".
Run Code Online (Sandbox Code Playgroud)

我已经清理了删除空格的类,但错误仍然存​​在。

Lan*_*dys 6

按如下方式删除 Span,它应该可以工作。我有类似的配置文件。

Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa
Host github-panthro
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_panthro
Run Code Online (Sandbox Code Playgroud)