linux 错误的配置选项:Identityfile

3j86kqsm  于 5个月前  发布在  Linux
关注(0)|答案(2)|浏览(85)

我的ssh配置是好的,它是工作正常,但最近我的Github ssh连接不工作,我也无法连接到我的私人服务器使用ssh连接。当我尝试ssh,我得到以下错误:

/home/hacku/.ssh/config: line 9: Bad configuration option: Identityfile
/home/hacku/.ssh/config: line 16: Bad configuration option: Identityfile
/home/hacku/.ssh/config: terminating, 2 bad configuration options

字符串
下面是我的配置文件:

Host github.com

User git

Port 22

Hostname github.com

IdentityFile ~/.ssh/github_ssh
TCPKeepAlive yes

Host linode
    HostName serv_ip_address
    User hackU
    Port 22
    IdentityFile ~/.ssh/private_key


我复制了完全相同的配置文件和我的私钥到另一台机器,它工作得很好(Termux,ssh version => OpenSSH_8.6p1,OpenSSL 1.1.1l 24 Aug 2021)。
我检查了我的ssh包版本,它是OpenSSH_8.7p1,所以我想可能是更新破坏了它。所以我降级到OpenSSH_8.6p1,OpenSSL 1.1.1l 24 Aug 2021,它也不工作,此外,我试图重新启动sshd使用
第一个月
但以上都不管用。
我使用manjaro侏儒版作为我的日常驱动程序。
先谢了。

ee7vknir

ee7vknir1#

理论上一切似乎都没问题,但问题是它奇怪地抛出了这个错误。在做了一些阅读之后,I found this information here
如果你使用ssh-agent,ssh会自动尝试使用agent中的密钥,即使你没有在ssh_config的IdentityFile(或-i)选项中指定它们。这是你可能会得到用户错误的太多身份验证失败的常见原因。使用IdentitiesOnly yes选项将禁用此行为。
所以我完全删除了IdentityFile选项。因此,我的最终配置文件是这样的,两个连接都工作正常。

Host github.com
    User git
    Port 22
    Hostname github.com
    TCPKeepAlive yes

Host linode
    HostName server_ip_address
    User hackU
    Port 22

字符串
然而,这个问题的原因对我来说仍然是未知的。我很高兴听到,如果有人发现它。

t2a7ltrp

t2a7ltrp2#

我也遇到了同样的问题--根本无法向任何主机发送ssh。
我最近编辑了~/.ssh/config文件,并在 one 主机配置中键入了“IdentityFile”一词。在尝试连接到 any 主机之前,它必须检查整个文件。
修复了错别字,我又回到了连接。
希望能帮上忙。

相关问题