根据GitLab的文档配置OpenSSH

时间:2017-09-01 16:14:16

标签: gitlab ssh-keys openssh

我偶然发现GitLab's documentation for setting up OpenSSH keys

文档说创建文件~/.ssh/config并提供以下示例:

# GitLab.com server
Host gitlab.com
RSAAuthentication yes
IdentityFile ~/.ssh/config/private-key-filename-01

# Private GitLab server
Host gitlab.company.com
RSAAuthentication yes
IdentityFile ~/.ssh/config/private-key-filename

但是,我认为IdentityFile的示例路径应该是~/.ssh/private-key-filename而不是~/.ssh/config/private-key-filename,因为~/.ssh/config是文件而不是文件夹。
或者我错过了什么?

1 个答案:

答案 0 :(得分:1)

config文件路径与IdentityFile路径无关,您可以自由使用您想要的内容。但肯定存在一个错字,因为将密钥放在~/.ssh/config/目录中并不常见。大多数人的密钥都在~/.ssh/。你是对的,这个例子是错的。您不能拥有配置文件config以及包含密钥的config目录。

相关问题