【问题标题】:Configuring OpenSSH according to GitLab's documentation根据 GitLab 的文档配置 OpenSSH
【发布时间】:2018-02-10 18:10:26
【问题描述】:

我偶然发现了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 是文件而不是文件夹。
还是我错过了什么?

【问题讨论】:

    标签: gitlab ssh-keys openssh


    【解决方案1】:

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

    【讨论】:

    • 我怀疑~/.ssh/config已经是一个文件(没有任何文件扩展名的SSH配置文件)。因此,至少在我的环境(Ubuntu 14.04)中,我无法创建一个 文件夹 ~/.ssh/config/ 来将我的私钥放入其中。换句话说:您不能同时创建名称完全相同的文件和文件夹。
    • 你说得对,我编辑了答案。所以是的,这个例子是错误的。
    猜你喜欢
    • 2017-02-07
    • 1970-01-01
    • 1970-01-01
    • 2015-04-20
    • 2015-04-02
    • 2019-07-16
    • 2020-11-13
    • 1970-01-01
    相关资源
    最近更新 更多