根据GitLab的文档
问题描述:
我在GitLab's documentation for setting up OpenSSH keys偶然配置的OpenSSH:根据GitLab的文档
文档说创建一个文件~/.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
是一个文件而不是文件夹。
或者我错过了什么?
答
config
文件路径与IdentityFile
路径无关,你可以自由使用你想要的。但肯定存在拼写错误,因为将密钥放在~/.ssh/config/
目录中并不常见。大多数人的钥匙都在~/.ssh/
。你是对的,这个例子是错误的。您不能将配置文件config
与包含密钥的config
目录一起使用。
我的疑问是'〜/ .ssh/config'已经是*文件*(SSH配置文件没有任何文件扩展名)。因此,至少在我的环境中(Ubuntu 14.04),我无法创建一个*文件夹*'〜/ .ssh/config /'来将我的私钥放入其中。换句话说:您不能创建具有完全相同名称的文件和文件夹。 –
你是对的,我编辑了答案。所以是的这个例子是错误的。 – Guillaume