根据 GitLab 的文档配置 OpenSSH
Configuring OpenSSH according to GitLab's documentation
我偶然发现了 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
是文件而不是文件夹。
还是我遗漏了什么?
config
文件路径与IdentityFile
路径无关,您可以随意使用。但是肯定有一个错字,因为将密钥放在 ~/.ssh/config/
目录中并不常见。大多数人的钥匙都在 ~/.ssh/
。你是对的,这个例子是错误的。您不能同时拥有配置文件 config
和包含密钥的 config
目录。
我偶然发现了 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
是文件而不是文件夹。
还是我遗漏了什么?
config
文件路径与IdentityFile
路径无关,您可以随意使用。但是肯定有一个错字,因为将密钥放在 ~/.ssh/config/
目录中并不常见。大多数人的钥匙都在 ~/.ssh/
。你是对的,这个例子是错误的。您不能同时拥有配置文件 config
和包含密钥的 config
目录。