{"id":8027,"date":"2022-07-25T09:50:10","date_gmt":"2022-07-25T01:50:10","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=8027"},"modified":"2022-07-25T20:53:30","modified_gmt":"2022-07-25T12:53:30","slug":"ssh-login-slowly","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/ssh-login-slowly.html","title":{"rendered":"ssh\u767b\u5f55\u5f88\u6162\u89e3\u51b3\u65b9\u6cd5"},"content":{"rendered":"
\n

\u672c\u6587\u7531lrxjmw.cn\u56e2\u961f\u6210\u5458\u9b4f\u4e3d\u733f<\/span>\u6574\u7406\u53d1\u5e03\uff0c\u539f\u6587\u6765\u81ea\uff1aLinux\u8fd0\u7ef4\u7b14\u8bb0<\/a>\u3002<\/p>\n<\/div>\n

\u4f7f\u7528ssh\u5ba2\u6237\u7aef\uff08\u5982\uff1aputty\uff09\u8fde\u63a5Linux\u670d\u52a1\u5668\uff0c\u53ef\u80fd\u4f1a\u7b49\u5f8510-30\u79d2\u624d\u6709\u63d0\u793a\u8f93\u5165\u5bc6\u7801\uff0c\u4e25\u91cd\u5f71\u54cd\u5de5\u4f5c\u6548\u7387\u3002\u767b\u5f55\u5f88\u6162\uff0c\u767b\u5f55\u4e0a\u53bb\u540e\u901f\u5ea6\u6b63\u5e38\uff0c\u8fd9\u79cd\u60c5\u51b5\u4e3b\u8981\u6709\u4e24\u79cd\u53ef\u80fd\u7684\u539f\u56e0\uff1a<\/p>\n

1. DNS\u53cd\u5411\u89e3\u6790\u95ee\u9898<\/strong><\/div>\n

OpenSSH\u5728\u7528\u6237\u767b\u5f55\u7684\u65f6\u5019\u4f1a\u9a8c\u8bc1IP\uff0c\u5b83\u6839\u636e\u7528\u6237\u7684IP\u4f7f\u7528\u53cd\u5411DNS\u627e\u5230\u4e3b\u673a\u540d\uff0c\u518d\u4f7f\u7528DNS\u627e\u5230IP\u5730\u5740\uff0c\u6700\u540e\u5339\u914d\u4e00\u4e0b\u767b\u5f55\u7684IP\u662f\u5426\u5408\u6cd5\u3002\u5982\u679c\u5ba2\u6237\u673a\u7684IP\u6ca1\u6709\u57df\u540d\uff0c\u6216\u8005DNS\u670d\u52a1\u5668\u5f88\u6162\u6216\u4e0d\u901a\uff0c\u90a3\u4e48\u767b\u5f55\u5c31\u4f1a\u5f88\u82b1\u65f6\u95f4\u3002<\/p>\n

\u89e3\u51b3\u529e\u6cd5\uff1a<\/strong><\/span><\/div>\n

\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u4fee\u6539sshd\u670d\u52a1\u5668\u7aef\u914d\u7f6e,\u5e76\u91cd\u542fsshd<\/p>\n

vi \/etc\/ssh\/sshd_config\r\nUseDNS no<\/pre>\n
2. \u5173\u95edssh\u7684gssapi\u8ba4\u8bc1<\/strong><\/div>\n

\u7528ssh -v user@server \u53ef\u4ee5\u770b\u5230\u767b\u5f55\u65f6\u6709\u5982\u4e0b\u4fe1\u606f\uff1a<\/p>\n

debug1: Next authentication method: gssapi-with-mic\r\ndebug1: Unspecified GSS failure. Minor code may provide more information<\/pre>\n

\u6ce8\uff1assh -vvv user@server \u53ef\u4ee5\u770b\u5230\u66f4\u7ec6\u7684debug\u4fe1\u606f<\/p>\n

\u89e3\u51b3\u529e\u6cd5\uff1a<\/strong><\/span><\/div>\n

\u4fee\u6539sshd\u670d\u52a1\u5668\u7aef\u914d\u7f6e<\/p>\n

vi \/etc\/ssh\/ssh_config\r\nGSSAPIAuthentication no<\/pre>\n

\u53ef\u4ee5\u4f7f\u7528ssh -o GSSAPIAuthentication=no user@server\u767b\u5f55
\nGSSAPI ( Generic Security Services Application Programming Interface) \u662f\u4e00\u5957\u7c7b\u4f3cKerberos 5\u7684\u901a\u7528\u7f51\u7edc\u5b89\u5168\u7cfb\u7edf\u63a5\u53e3\uff0c\u8be5\u63a5\u53e3\u662f\u5bf9\u5404\u79cd\u4e0d\u540c\u7684\u5ba2\u6237\u7aef\u670d\u52a1\u5668\u5b89\u5168\u673a\u5236\u7684\u5c01\u88c5\uff0c\u4ee5\u6d88\u9664\u5b89\u5168\u63a5\u53e3\u7684\u4e0d\u540c\uff0c\u964d\u4f4e\u7f16\u7a0b\u96be\u5ea6\uff0c\u4f46\u8be5\u63a5\u53e3\u5728\u76ee\u6807\u673a\u5668\u65e0\u57df\u540d\u89e3\u6790\u65f6\u4f1a\u6709\u95ee\u9898,\u4f7f\u7528strace\u67e5\u770b\u540e\u53d1\u73b0\uff0cssh\u5728\u9a8c\u8bc1\u5b8ckey\u4e4b\u540e\uff0c\u8fdb\u884cauthentication gssapi-with-mic\uff0c\u6b64\u65f6\u5148\u53bb\u8fde\u63a5DNS\u670d\u52a1\u5668\uff0c\u5728\u8fd9\u4e4b\u540e\u4f1a\u8fdb\u884c\u5176\u4ed6\u64cd\u4f5c\u3002<\/p>\n\n\n\n
<\/td>\n\u76f8\u5173\u5b66\u4e60\u94fe\u63a5\uff1ahttp:\/\/lrxjmw.cn\/chapter-08\/#83<\/a><\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
\n

\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/blog.linuxeye.com\/420.html<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/ssh-login-slowly.html<\/a>\u7f16\u8f91\uff1a\u9b4f\u4e3d\u733f\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u4f7f\u7528ssh\u5ba2\u6237\u7aef\uff08\u5982\uff1aputty\uff09\u8fde\u63a5Linux\u670d\u52a1\u5668\uff0c\u53ef\u80fd\u4f1a\u7b49\u5f8510-30\u79d2\u624d\u6709\u63d0\u793a\u8f93\u5165\u5bc6\u7801\uff0c\u4e25\u91cd\u5f71\u54cd\u5de5\u4f5c\u6548 […]<\/p>\n","protected":false},"author":309,"featured_media":8031,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-8027","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/8027","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/309"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=8027"}],"version-history":[{"count":7,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/8027\/revisions"}],"predecessor-version":[{"id":248820,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/8027\/revisions\/248820"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/8031"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=8027"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=8027"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=8027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}