{"id":133,"date":"2018-10-18T08:25:47","date_gmt":"2018-10-18T00:25:47","guid":{"rendered":"\/\/hqidi.com\/?p=133"},"modified":"2018-10-18T08:25:47","modified_gmt":"2018-10-18T00:25:47","slug":"sshd%e6%9c%8d%e5%8a%a1%e5%90%af%e5%8a%a8%e5%a4%b1%e8%b4%a5","status":"publish","type":"post","link":"https:\/\/hqidi.com\/133.html","title":{"rendered":"SSHD\u670d\u52a1\u542f\u52a8\u5931\u8d25"},"content":{"rendered":"<p>\u4e00\u53f0\u5728\u7ebf\u624d5\u5929\u7684\u670d\u52a1\u5668\uff0c\u7528 lastb |wc -l \u7edf\u8ba1\u4e86\u4e0b\uff0c\u6709\u8fd1\u5341\u4e07\u6b21\u7684\u66b4\u529b\u7834\u89e3\u767b\u5f55\u5931\u8d25\u8bb0\u5f55\u3002\u96a7\u60f3\u6539\u4e0bsshd \u7684\u76d1\u542c\u7aef\u53e3\uff0c\u514d\u5f97\u62db\u8702\u5f15\u8776\u3002<br \/>\n\u6253\u5f00\u914d\u7f6e\u6587\u4ef6 \/etc\/ssh\/sshd_config \u628a\u9ed8\u8ba4\u768422\u7aef\u53e3\u6539\u6210\u9ad8\u4f4d\u7aef\u53e3\u540e\uff0c\u7528 systemctl restart sshd.service \u91cd\u542fsshd\u670d\u52a1\u5931\u8d25\u3002<br \/>\n\u62a5\u9519\u5982\u4e0b\uff1a<\/p>\n<blockquote><p>Job for sshd.service failed because the control process exited with error code. See \"systemctl status sshd.service\" and \"journalctl -xe\" for details.<\/p><\/blockquote>\n<p>systemctl status sshd.service \u7684\u8f93\u51fa\u5982\u4e0b\uff1a<\/p>\n<blockquote><p>\u25cf sshd.service - OpenSSH server daemon<br \/>\n   Loaded: loaded (\/usr\/lib\/systemd\/system\/sshd.service; enabled; vendor preset: enabled)<br \/>\n   Active: activating (auto-restart) (Result: exit-code) since \u56db 2018-09-27 10:10:42 CST; 38s ago<br \/>\n     Docs: man:sshd(8)<br \/>\n           man:sshd_config(5)<br \/>\n  Process: 47324 ExecStart=\/usr\/sbin\/sshd -D $OPTIONS (code=exited, status=255)<br \/>\n Main PID: 47324 (code=exited, status=255)<\/p>\n<p>9\u6708 27 10:10:42 english systemd[1]: sshd.service: main process exited, code=exited, status=255\/n\/a<br \/>\n9\u6708 27 10:10:42 english systemd[1]: Failed to start OpenSSH server daemon.<br \/>\n9\u6708 27 10:10:42 english systemd[1]: Unit sshd.service entered failed state.<br \/>\n9\u6708 27 10:10:42 english systemd[1]: sshd.service failed.<\/p><\/blockquote>\n<p>\u6ca1\u5565\u6709\u7528\u7684\u63d0\u793a\uff0c\u518d\u770b journalctl -xe <\/p>\n<blockquote><p>-- Unit sshd.service has begun starting up.<br \/>\n9\u6708 27 10:12:07 english sshd[47352]: error: Bind to port 23389 on 0.0.0.0 failed: Permission denied.<br \/>\n9\u6708 27 10:12:07 english sshd[47352]: error: Bind to port 23389 on :: failed: Permission denied.<br \/>\n9\u6708 27 10:12:07 english sshd[47352]: fatal: Cannot bind any address.<br \/>\n9\u6708 27 10:12:07 english systemd[1]: sshd.service: main process exited, code=exited, status=255\/n\/a<br \/>\n9\u6708 27 10:12:07 english systemd[1]: Failed to start OpenSSH server daemon.<br \/>\n-- Subject: Unit sshd.service has failed<br \/>\n-- Defined-By: systemd<\/p><\/blockquote>\n<p>\u8bf4\u6211\u6ca1\u6743\u9650\u7ed1\u5b9a 23389 \u7aef\u53e3\uff0c\u8001\u592b\u662f root \u548b\u4f1a\u6ca1\u6743\u9650\u5462\uff1f\/var\/log\/messages \u91cc\u9762\u6ca1\u6709\u5565\u6709\u7528\u7684\u63d0\u793a\uff0c\/var\/log\/secure\u91cc\u9762\u7684\u63d0\u793a\u8ddf\u4e0a\u9762\u663e\u793a\u4e00\u6837\uff0c\u6ca1\u6743\u9650\u3002\u4e24\u5934\u96fe\u6c34\u3002<\/p>\n<p>\u7ecf\u9a8c\u544a\u8bc9\u6211\uff0c\u5f53\u65e5\u5fd7\u91cc\u9762\u6ca1\u660e\u663e\u63d0\u793a\uff0c\u800c\u670d\u52a1\u53c8\u662f\u548c\u5b89\u5168\u76f8\u5173\u7684\u65f6\u5019\uff0c\u9505\u5f80selinux\u4e0a\u7529\u51c6\u6ca1\u9519\uff0c\u679c\u7136 getenforce \u8fd4\u56de\u7684\u662f Enforcing \u3002<br \/>\n\u6267\u884c setenforce 0 \u5173\u95edselinux\u540e\uff0c\u4e00\u5207\u6b63\u5e38\u3002<\/p>\n<p>\u6700\u540e\u63d0\u9192\u4e0b\uff0c\u4fee\u6539sshd\u914d\u7f6e\u6587\u4ef6\u5c5e\u4e8e\u9ad8\u5371\u64cd\u4f5c\uff0c\u8981\u614e\u4e4b\u53c8\u614e\uff0c\u5982\u4e0a\u6587\uff0c\u7aef\u53e3\u6539\u621023389\u540e\uff0c\u4f60\u91cd\u542fsshd\u670d\u52a1\u8ba9\u4fee\u6539\u751f\u6548\uff0c\u91cd\u542f\u8fd9\u4e2a\u52a8\u4f5c\u5206\u89e3\u662f\u8fd9\u6837\u7684\uff1a<br \/>\n1\u3001\u505c\u6b62SSHD\u670d\u52a1<br \/>\n2\u3001\u7528\u4fee\u6539\u540e\u7684\u65b0\u914d\u7f6e\u6587\u4ef6\u542f\u52a8SSHD\u670d\u52a1\uff0c\u800c\u6b64\u65f6\u914d\u7f6e\u6587\u4ef6\u6709\u8bef\uff0c\u65e0\u6cd5\u542f\u52a8SSHD\u3002<br \/>\n\u65e0\u6cd5\u542f\u52a8SSHD\u670d\u52a1\uff0c\u8fd9\u60f3\u60f3\u90fd\u523a\u6fc0\u5462\uff1f\u82e5\u662f\u4e91\u670d\u52a1\u5668\u8fd8\u597d\uff0c\u53ef\u4ee5\u901a\u8fc7web\u63a7\u5236\u53f0\u7684console\u8fde\u63a5\u4e0a\u53bb\u64cd\u4f5c\uff0c\u82e5\u662f\u6258\u7ba1\u5728IDC\u673a\u623f\u7684\u673a\u5668\uff0c\u53ea\u80fd\u53bb\u673a\u623f\u63a5\u663e\u793a\u5668\u4e86\u3002\u6bd4\u8f83\u5b89\u5168\u7684\u65b9\u6cd5\u5c31\u662f\u7528\u4e00\u4e2a\u811a\u672c\u6bcf\u969420\u5206\u949f\u628a\u6b63\u786e\u7684sshd\u914d\u7f6e\u6587\u4ef6\u8986\u76d6\u56de\u6765\uff0c\u7136\u540e\u542f\u52a8SSHD\u670d\u52a1\uff0c\u5f53\u4f60\u786e\u8ba4\u4fee\u6539\u6210\u529f\u540e\uff0c\u518d\u53d6\u6d88\u6389\u8fd9\u4e2a\u811a\u672c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u53f0\u5728\u7ebf\u624d5\u5929\u7684\u670d\u52a1\u5668\uff0c\u7528 lastb |wc -l \u7edf\u8ba1\u4e86\u4e0b\uff0c\u6709\u8fd1\u5341\u4e07\u6b21\u7684\u66b4\u529b\u7834\u89e3\u767b\u5f55\u5931\u8d25\u8bb0\u5f55\u3002\u96a7\u60f3\u6539\u4e0bsshd \u7684\u76d1\u542c\u7aef\u53e3\uff0c\u514d\u5f97\u62db\u8702\u5f15\u8776\u3002 \u6253\u5f00\u914d\u7f6e\u6587\u4ef6 \/etc\/ssh\/sshd_config \u628a\u9ed8\u8ba4\u768422\u7aef\u53e3\u6539\u6210\u9ad8\u4f4d\u7aef\u53e3\u540e\uff0c\u7528 systemctl restart sshd.service \u91cd\u542fsshd\u670d\u52a1\u5931\u8d25\u3002 \u62a5\u9519\u5982\u4e0b\uff1a Job for sshd....<\/p>\n<a class=\"read-more\" href=\"https:\/\/hqidi.com\/133.html\">\u9605\u8bfb\u5168\u6587 &raquo;<\/a>","protected":false},"author":1,"featured_media":3093,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[95],"class_list":["post-133","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-work","tag-sshd"],"_links":{"self":[{"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/posts\/133"}],"collection":[{"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/comments?post=133"}],"version-history":[{"count":1,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/posts\/133\/revisions"}],"predecessor-version":[{"id":3624,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/posts\/133\/revisions\/3624"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/media\/3093"}],"wp:attachment":[{"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/media?parent=133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/categories?post=133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/tags?post=133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}