根据GitLab配置OpenSSH';s文件

根据GitLab配置OpenSSH';s文件,gitlab,ssh-keys,openssh,Gitlab,Ssh Keys,Openssh,我偶然发现: 文档说明创建一个文件~/.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/pri

我偶然发现:

文档说明创建一个文件
~/.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
是一个文件而不是一个文件夹。

还是我遗漏了什么?

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

我怀疑
~/.ssh/config
已经是一个文件(没有任何文件扩展名的ssh配置文件)。因此,至少在我的环境(Ubuntu14.04)中,我无法创建文件夹
~/.ssh/config/
,将私钥放入其中。换句话说,你不能用完全相同的名称创建文件和文件夹。没错,我编辑了答案。是的,这个例子是错误的。