zoukankan      html  css  js  c++  java
  • ssh: Bad configuration option: usedns

    某天突然听到同事说服务器上git用不了了,上去一看,确实用不了了,git pull报出了如下错误:

    $ git pull
    /etc/ssh/ssh_config: line 56: Bad configuration option: usedns
    /etc/ssh/ssh_config: terminating, 1 bad configuration options
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.

    看到了是ssh配置导致的错误,并且关键词为:“usedns”,然后想起来,今天是有另一个同事为了加速ssh登陆改了一下这个配置。于是将/etc/ssh/ssh_config中的UseDNS改为了yes,并重启了ssh。

    但是很遗憾,问题仍旧存在,于是查看了ssh_config配置手册

    $ man ssh_config
    NAME
         ssh_config — OpenSSH SSH client configuration files
    
    SYNOPSIS
         ~/.ssh/config
         /etc/ssh/ssh_config

    全局搜索ssh_config发现并没有UseDNS的配置,然后详细的看了下同事更改配置的说明是修改了/etc/ssh/sshd_config,然后再查看sshd_config的手册:

    $ man sshd_config
    NAME
         sshd_config — OpenSSH SSH daemon configuration file
    
    SYNOPSIS
         /etc/ssh/sshd_config

    果然在sshd_config配置中搜索到了UseDNS配置,所以很明显是同事配置各个服务器的时候,手误了,误把sshd_config里的配置改到了ssh_config,进而导致了上述问题。将UseDNS的配置改到了/etc/ssh/ssh_config之中果然就好了。

    另外可以说一下,ssh_config和sshd_config的区别:ssh_config和sshd_config都是ssh服务器的配置文件,二者区别在于,前者是针对客户端的配置文件,后者则是针对服务端的配置文件。两个配置文件都允许通过设置不同的选项来改变客户端程序的运行方式。

  • 相关阅读:
    Python学习之==>第三方模块的安装、模块导入
    Python学习之==>json处理
    Python学习之==>内置函数、列表生成式、三元表达式
    Python学习之==>函数
    Python学习之==>文件操作
    Python学习之==>集合
    函数,递归,内置函数
    python流程控制
    python文件处理
    Python基础之数据类型
  • 原文地址:https://www.cnblogs.com/minglee/p/11210203.html
Copyright © 2011-2022 走看看