位置: 编程技术 - 正文

Linux SSH登录很慢的解决方法(linux ssh 登录)

编辑:rootadmin

推荐整理分享Linux SSH登录很慢的解决方法(linux ssh 登录),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:linuxssh登录时间长,linux ssh登录命令,linux ssh登陆慢,linux ssh登陆慢,linux ssh 登录,linuxssh登录时间长,linux ssh登录失败日志,linux ssh登录失败日志,内容如对您有帮助,希望把文章链接给更多的朋友!

使用ssh客户端(如:putty)连接Linux服务器,可能会等待-秒才有提示输入密码。严重影响工作效率。登录很慢,登录上去后速度正常,这种情况主要有两种可能的原因:

1. DNS反向解析问题

OpenSSH在用户登录的时候会验证IP,它根据用户的IP使用反向DNS找到主机名,再使用DNS找到IP地址,最后匹配一下登录的IP是否合法。如果客户机的IP没有域名,或者DNS服务器很慢或不通,那么登录就会很花时间。

解决办法:

在目标服务器上修改sshd服务器端配置,并重启sshd复制代码代码如下:vi /etc/ssh/sshd_configUseDNS no

Linux SSH登录很慢的解决方法(linux ssh 登录)

2. 关闭ssh的gssapi认证

用ssh -v user@server 可以看到登录时有如下信息:复制代码代码如下:debug1: Next authentication method: gssapi-with-micdebug1: Unspecified GSS failure. Minor code may provide more information注:ssh -vvv user@server 可以看到更细的debug信息

解决办法:

修改sshd服务器端配置复制代码代码如下:vi /etc/ssh/ssh_configGSSAPIAuthentication no可以使用ssh -o GSSAPIAuthentication=no user@server登录

GSSAPI ( Generic Security Services Application Programming Interface) 是一套类似Kerberos 5的通用网络安全系统接口。该接口是对各种不同的客户端服务器安全机制的封装,以消除安全接口的不同,降低编程难度。但该接口在目标机器无域名解析时会有问题

使用strace查看后发现,ssh在验证完key之后,进行authentication gssapi-with-mic,此时先去连接DNS服务器,在这之后会进行其他操作复制代码代码如下:[root@--3- ~]# ssh -vvv root@..3.OpenSSH_5.3p1, OpenSSL 1.0.1e-fips Feb debug1: Reading configuration data /etc/ssh/ssh_configdebug1: Applying options for *debug2: ssh_connect: needpriv 0debug1: Connecting to ..3. [..3.] port .debug1: Connection established.debug1: permanently_set_uid: 0/0debug1: identity file /root/.ssh/identity type -1debug1: identity file /root/.ssh/identity-cert type -1debug1: identity file /root/.ssh/id_rsa type -1debug1: identity file /root/.ssh/id_rsa-cert type -1debug1: identity file /root/.ssh/id_dsa type -1debug1: identity file /root/.ssh/id_dsa-cert type -1debug1: identity file /root/.ssh/id_ecdsa type -1debug1: identity file /root/.ssh/id_ecdsa-cert type -1debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3debug1: match: OpenSSH_5.3 pat OpenSSH*debug1: Enabling compatibility mode for protocol 2.0debug1: Local version string SSH-2.0-OpenSSH_5.3debug2: fd 3 setting O_NONBLOCKdebug1: SSH2_MSG_KEXINIT sentdebug3: Wrote bytes for a total of debug1: SSH2_MSG_KEXINIT receiveddebug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha,diffie-hellman-group-exchange-sha1,diffie-hellman-group-sha1,diffie-hellman-group1-sha1debug2: kex_parse_kexinit: ssh-rsa-cert-v@openssh.com,ssh-dss-cert-v@openssh.com,ssh-rsa-cert-v@openssh.com,ssh-dss-cert-v@openssh.com,ssh-rsa,ssh-dssdebug2: kex_parse_kexinit: aes-ctr,aes-ctr,aes-ctr,arcfour,arcfour,aes-cbc,3des-cbc,blowfish-cbc,cast-cbc,aes-cbc,aes-cbc,arcfour,rijndael-cbc@lysator.liu.sedebug2: kex_parse_kexinit: aes-ctr,aes-ctr,aes-ctr,arcfour,arcfour,aes-cbc,3des-cbc,blowfish-cbc,cast-cbc,aes-cbc,aes-cbc,arcfour,rijndael-cbc@lysator.liu.sedebug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-@openssh.com,hmac-sha2-,hmac-sha2-,hmac-ripemd,hmac-ripemd@openssh.com,hmac-sha1-,hmac-md5-debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-@openssh.com,hmac-sha2-,hmac-sha2-,hmac-ripemd,hmac-ripemd@openssh.com,hmac-sha1-,hmac-md5-debug2: kex_parse_kexinit: none,zlib@openssh.com,zlibdebug2: kex_parse_kexinit: none,zlib@openssh.com,zlibdebug2: kex_parse_kexinit:debug2: kex_parse_kexinit:debug2: kex_parse_kexinit: first_kex_follows 0debug2: kex_parse_kexinit: reserved 0debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha,diffie-hellman-group-exchange-sha1,diffie-hellman-group-sha1,diffie-hellman-group1-sha1debug2: kex_parse_kexinit: ssh-rsa,ssh-dssdebug2: kex_parse_kexinit: aes-ctr,aes-ctr,aes-ctr,arcfour,arcfour,aes-cbc,3des-cbc,blowfish-cbc,cast-cbc,aes-cbc,aes-cbc,arcfour,rijndael-cbc@lysator.liu.sedebug2: kex_parse_kexinit: aes-ctr,aes-ctr,aes-ctr,arcfour,arcfour,aes-cbc,3des-cbc,blowfish-cbc,cast-cbc,aes-cbc,aes-cbc,arcfour,rijndael-cbc@lysator.liu.sedebug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-@openssh.com,hmac-sha2-,hmac-sha2-,hmac-ripemd,hmac-ripemd@openssh.com,hmac-sha1-,hmac-md5-debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-@openssh.com,hmac-sha2-,hmac-sha2-,hmac-ripemd,hmac-ripemd@openssh.com,hmac-sha1-,hmac-md5-debug2: kex_parse_kexinit: none,zlib@openssh.comdebug2: kex_parse_kexinit: none,zlib@openssh.comdebug2: kex_parse_kexinit:debug2: kex_parse_kexinit:debug2: kex_parse_kexinit: first_kex_follows 0debug2: kex_parse_kexinit: reserved 0debug2: mac_setup: found hmac-md5debug1: kex: server->client aes-ctr hmac-md5 nonedebug2: mac_setup: found hmac-md5debug1: kex: client->server aes-ctr hmac-md5 nonedebug1: SSH2_MSG_KEX_DH_GEX_REQUEST(<<) sentdebug1: expecting SSH2_MSG_KEX_DH_GEX_GROUPdebug3: Wrote bytes for a total of debug2: dh_gen_key: priv key bits set: /debug2: bits set: /debug1: SSH2_MSG_KEX_DH_GEX_INIT sentdebug1: expecting SSH2_MSG_KEX_DH_GEX_REPLYdebug3: Wrote bytes for a total of debug3: check_host_in_hostfile: host ..3. filename /root/.ssh/known_hostsdebug3: check_host_in_hostfile: host ..3. filename /root/.ssh/known_hostsdebug3: check_host_in_hostfile: match line 8debug1: Host '..3.' is known and matches the RSA host key.debug1: Found key in /root/.ssh/known_hosts:8debug2: bits set: /debug1: ssh_rsa_verify: signature correctdebug2: kex_derive_keysdebug2: set_newkeys: mode 1debug1: SSH2_MSG_NEWKEYS sentdebug1: expecting SSH2_MSG_NEWKEYSdebug3: Wrote bytes for a total of debug2: set_newkeys: mode 0debug1: SSH2_MSG_NEWKEYS receiveddebug1: SSH2_MSG_SERVICE_REQUEST sentdebug3: Wrote bytes for a total of debug2: service_accept: ssh-userauthdebug1: SSH2_MSG_SERVICE_ACCEPT receiveddebug2: key: /root/.ssh/identity ((nil))debug2: key: /root/.ssh/id_rsa ((nil))debug2: key: /root/.ssh/id_dsa ((nil))debug2: key: /root/.ssh/id_ecdsa ((nil))debug3: Wrote bytes for a total of debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,passworddebug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic,passworddebug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,passworddebug3: authmethod_lookup gssapi-keyexdebug3: remaining preferred: gssapi-with-mic,publickey,keyboard-interactive,passworddebug3: authmethod_is_enabled gssapi-keyexdebug1: Next authentication method: gssapi-keyexdebug1: No valid Key exchange contextdebug2: we did not send a packet, disable methoddebug3: authmethod_lookup gssapi-with-micdebug3: remaining preferred: publickey,keyboard-interactive,passworddebug3: authmethod_is_enabled gssapi-with-micdebug1: Next authentication method: gssapi-with-micdebug3: Trying to reverse map address ..3..debug1: Unspecified GSS failure. Minor code may provide more informationCannot determine realm for numeric host address</p><p>debug1: Unspecified GSS failure. Minor code may provide more informationCannot determine realm for numeric host address</p><p>debug1: Unspecified GSS failure. Minor code may provide more information</p><p>debug1: Unspecified GSS failure. Minor code may provide more informationCannot determine realm for numeric host address</p><p>debug2: we did not send a packet, disable methoddebug3: authmethod_lookup publickeydebug3: remaining preferred: keyboard-interactive,passworddebug3: authmethod_is_enabled publickeydebug1: Next authentication method: publickeydebug1: Trying private key: /root/.ssh/identitydebug3: no such identity: /root/.ssh/identitydebug1: Trying private key: /root/.ssh/id_rsadebug3: no such identity: /root/.ssh/id_rsadebug1: Trying private key: /root/.ssh/id_dsadebug3: no such identity: /root/.ssh/id_dsadebug1: Trying private key: /root/.ssh/id_ecdsadebug3: no such identity: /root/.ssh/id_ecdsadebug2: we did not send a packet, disable methoddebug3: authmethod_lookup passworddebug3: remaining preferred: ,passworddebug3: authmethod_is_enabled passworddebug1: Next authentication method: passwordroot@..3.'s password:

Linux中的内置命令和外部命令详解 Linux的命令分为内部命令和外部命令:1.内部命令在系统启动时就调入内存,是常驻内存的,所以执行效率高。2.外部命令是系统的软件功能,用户需要

在Linux中使用命令行计算器GNU bc的方法 每个现代的Linux桌面发行版都预装着一个带有图形界面的计算器程序。不过如果你的工作区中全是命令行窗口,那么你一定会在其中的一个命令行窗口中

个高效但不常见的Linux命令 1.mvxxxx{,.bak}等同于mvxxxxxxxx.bak2.esc+.能填充之前命令的最后一个字段3.diff(sshhost1catfile1)(sshhost2catfile2)diff两个远程文件4.ctrl+r然后输入xxx,搜索之前包含xxx

标签: linux ssh 登录

本文链接地址:https://www.jiuchutong.com/biancheng/366864.html 转载请保留说明!

上一篇:Linux中使用ss命令检查网络连接的方法(linux的ssr)

下一篇:Linux中的内置命令和外部命令详解(linux内核命名)

  • 个税手续费返还会计分录
  • 退税进度显示国库退库失败怎么办 是什么原因
  • 零售环节征收消费税标准
  • 财务软件属于哪种软件
  • 给职工租房的房租怎么进行账务处理?
  • 财务费用包含哪些项目
  • 定期定额自行申报流程
  • 契税计入税金及附加吗
  • 现金流量表的编制基础是什么
  • 保本理财收益计入什么科目
  • 房屋折旧计提完成价格还能调整吗
  • 百旺税盘网络连接不上
  • 本月进项留抵会计分录
  • 工业会计成本核算分录
  • 租金收入需要缴增值税吗
  • 企业作为二房东要交什么税
  • 小规模纳税人购车是怎么抵税的
  • 律师事务所计提准备金的标准
  • 哪些发票无法全开
  • 如何算清楚公司的账
  • 建安业核定征收利润率
  • 增值税发票系统金税盘发票怎么抵扣
  • 公司注销了帐户钱能办款
  • 企业可以采用在产品按固定成本计算法的有
  • 当无法取得对应报价时,将以即时现价报单
  • 月末结转增值税凭证
  • 1697508230
  • 租房税收缴款书在哪里打印
  • 进出口免抵退税操作
  • 财务软件的摊销额计入管理费用
  • nmap命令
  • 发生坏账账务处理
  • 计提企业所得税会计分录怎么做
  • 利息收入增值税确认时点
  • 收不回的应收账款分录
  • 进项税额转出余额在贷方怎么处理
  • 生活补助费能不能退回来
  • 阳光照耀下的人
  • php文件包含的4种方式
  • 进项税不得抵扣的意思
  • 个人独资企业的特点
  • pytorch with no grad
  • vue区别
  • 微软 大中华区 前副总裁
  • exfat转换fat32命令
  • 自然人三方协议支付宝怎么处理
  • 自行研发非专利技术入账金额包括增值税吗
  • 织梦的首页怎么换图片
  • 准则对()、()和()等作出基本规定
  • 一般纳税人企业所得税5%还是25%
  • 银行承兑汇票和贴现的区别
  • 公交车经营权转让案例
  • 长期持股的最好方法
  • 预付账款未取得发票
  • 航天信息税票
  • 如何理解其他应收款的概念
  • 没有发票的费用支出怎么入账
  • 税种工会经费
  • 会计结转是什么意思
  • 会计账本是一年一本吗
  • 盈余公积的构成
  • sqlserver模糊查询不用like
  • win10系统优酷播放不了
  • centos7创建swap分区
  • win7怎么添加自启动程序
  • win10回收站文件在哪里
  • gnaupdaemon.exe是什么
  • win7系统无法自动检测此网络的代理设置
  • unity开发用什么电脑比较好
  • 详解Javascript ES6中的箭头函数(Arrow Functions)
  • 在文本输入框中的输入内容是
  • js中正则表达式语法
  • 从零开始学什么好
  • js浏览器运行机制
  • unity动画教程
  • python解析算法
  • 南京税务局几点上班几点下班
  • 贵州新农合可以打电话停保吗
  • 企业所得税法中所称有关的支出是指
  • 新公司印花税的缴纳
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设