|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
欢迎大家来到仓酷云论坛!1、合用下令及计划以下:
【近程毗连及实行下令】
ssh-p22root@10.0.0.19
ssh-p22root@10.0.0.19/sbin/ifconfig
【近程拷贝:推送及拉取】
scp-P22-r-p/etcroot@10.0.0.19:/tmp/
scp-P22-r-proot@10.0.0.19:/tmp//etc
【宁静的FTP功效】
sftp-oPort=22root@10.0.0.19
【无暗码考证计划】
比方使用sshkey批量分发文件,实行安排操纵。
2、毗连慢的次要缘故原由是DNS剖析招致
办理***:
1、在ssh办事端上变动/etc/ssh/sshd_config文件中的设置为以下内容:
UseDNSno
#GSSAPIoptions
GSSAPIAuthenticationno
然后,实行/etc/init.d/sshdrestart重启sshd历程使上述设置失效,在毗连一样平常就不慢了。
2、假如还慢的话,反省ssh办事端上/etc/hosts文件中,127.0.0.1对应的主机名是不是和
uname-n的了局一样,大概把本机ip和hostname(uname-n了局)到场到/etc/hosts里。
- [root@C64~]#uname-nC64[root@C64~]#cat/etc/hosts#modibyoldboy11:122013/9/24127.0.0.1C64localhostlocalhost.localdomainlocalhost4localhost4.localdomain4::1localhostlocalhost.localdomainlocalhost6localhost6.localdomain610.0.0.18C64################
复制代码
3、使用ssh-v的调试功效查找慢的缘故原由
实在能够用上面的下令调试为何慢的细节(进修这个思绪很主要)。- [root@C64~]#ssh-vroot@10.0.0.19OpenSSH_5.3p1,OpenSSL1.0.0-fips29Mar2010debug1:Readingconfigurationdata/etc/ssh/ssh_configdebug1:Applyingoptionsfor*debug1:Connectingto10.0.0.19[10.0.0.19]port22.debug1:Connectionestablished.debug1:permanently_set_uid:0/0debug1:identityfile/root/.ssh/identitytype-1debug1:identityfile/root/.ssh/id_rsatype-1debug1:identityfile/root/.ssh/id_dsatype-1debug1:Remoteprotocolversion2.0,remotesoftwareversionOpenSSH_4.3debug1:match:OpenSSH_4.3patOpenSSH_4*debug1:Enablingcompatibilitymodeforprotocol2.0debug1:LocalversionstringSSH-2.0-OpenSSH_5.3debug1:SSH2_MSG_KEXINITsentdebug1:SSH2_MSG_KEXINITreceiveddebug1:kex:server->clientaes128-ctrhmac-md5nonedebug1:kex:client->serveraes128-ctrhmac-md5nonedebug1:SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192)sentdebug1:expectingSSH2_MSG_KEX_DH_GEX_GROUPdebug1:SSH2_MSG_KEX_DH_GEX_INITsentdebug1:expectingSSH2_MSG_KEX_DH_GEX_REPLYTheauthenticityofhost10.0.0.19(10.0.0.19)cantbeestablished.RSAkeyfingerprintisca:18:42:76:0e:5a:1c:7d:ef:fc:24:75:80:11:ad:f9.Areyousureyouwanttocontinueconnecting(yes/no)?yes=======>老男孩先生评:这里就是提醒保留密钥的交互提醒。Warning:Permanentlyadded10.0.0.19(RSA)tothelistofknownhosts.debug1:ssh_rsa_verify:signaturecorrectdebug1:SSH2_MSG_NEWKEYSsentdebug1:expectingSSH2_MSG_NEWKEYSdebug1:SSH2_MSG_NEWKEYSreceiveddebug1:SSH2_MSG_SERVICE_REQUESTsentdebug1:SSH2_MSG_SERVICE_ACCEPTreceiveddebug1:Authenticationsthatcancontinue:publickey,passworddebug1:Nextauthenticationmethod:publickeydebug1:Tryingprivatekey:/root/.ssh/identitydebug1:Tryingprivatekey:/root/.ssh/id_rsadebug1:Tryingprivatekey:/root/.ssh/id_dsadebug1:Nextauthenticationmethod:passwordroot@10.0.0.19spassword:=======>老男孩先生评:这里就是提醒输出暗码的交互提醒。debug1:Authenticationsucceeded(password).debug1:channel0:new[client-session]debug1:Enteringinteractivesession.debug1:Sendingenvironment.debug1:SendingenvLANG=en_US.UTF-8Lastlogin:TueSep2410:30:022013from10.0.0.18在近程毗连时假如慢就能够断定卡在哪了。[root@C64_A~]#ssh-voldboy@10.0.0.17OpenSSH_5.3p1,OpenSSL1.0.0-fips29Mar2010debug1:Readingconfigurationdata/etc/ssh/ssh_configdebug1:Applyingoptionsfor*debug1:Connectingto10.0.0.17[10.0.0.17]port22.debug1:Connectionestablished.debug1:permanently_set_uid:0/0debug1:identityfile/root/.ssh/identitytype-1debug1:identityfile/root/.ssh/id_rsatype-1debug1:identityfile/root/.ssh/id_dsatype2debug1:Remoteprotocolversion2.0,remotesoftwareversionOpenSSH_5.3debug1:match:OpenSSH_5.3patOpenSSH*debug1:Enablingcompatibilitymodeforprotocol2.0debug1:LocalversionstringSSH-2.0-OpenSSH_5.3debug1:SSH2_MSG_KEXINITsentdebug1:SSH2_MSG_KEXINITreceiveddebug1:kex:server->clientaes128-ctrhmac-md5nonedebug1:kex:client->serveraes128-ctrhmac-md5nonedebug1:SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192)sentdebug1:expectingSSH2_MSG_KEX_DH_GEX_GROUPdebug1:SSH2_MSG_KEX_DH_GEX_INITsentdebug1:expectingSSH2_MSG_KEX_DH_GEX_REPLYdebug1:Host10.0.0.17isknownandmatchestheRSAhostkey.debug1:Foundkeyin/root/.ssh/known_hosts:2debug1:ssh_rsa_verify:signaturecorrectdebug1:SSH2_MSG_NEWKEYSsentdebug1:expectingSSH2_MSG_NEWKEYSdebug1:SSH2_MSG_NEWKEYSreceiveddebug1:SSH2_MSG_SERVICE_REQUESTsentdebug1:SSH2_MSG_SERVICE_ACCEPTreceiveddebug1:Authenticationsthatcancontinue:publickey,gssapi-keyex,gssapi-with-mic,passworddebug1:Nextauthenticationmethod:gssapi-keyexdebug1:NovalidKeyexchangecontextdebug1:Nextauthenticationmethod:gssapi-with-mic
复制代码 上述设置没配就发明卡到gssapi这。就也许晓得是gssapi的成绩。
实践上在linux体系优化局部就应当优化SSH办事的此处。
本文出自“老男孩linux运维”博客,请务必保存此出处http://oldboy.blog.51cto.com/2561410/1300964
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的好朋友们! |
|