{"id":24,"date":"2018-06-14T22:52:18","date_gmt":"2018-06-14T13:52:18","guid":{"rendered":"http:\/\/vongg.com\/?p=24"},"modified":"2018-07-03T21:43:39","modified_gmt":"2018-07-03T12:43:39","slug":"centosday1","status":"publish","type":"post","link":"https:\/\/vongg.com\/?p=24","title":{"rendered":"centos\u670d\u52a1\u5668\u642d\u5efaDay1"},"content":{"rendered":"<p>Step1\uff0c\u505c\u6389sshd\u670d\u52a1<\/p>\n<pre style=\"padding-left: 60px;\">\u4e3a\u4e86\u5b89\u5168\u8d77\u89c1\uff0c\u5728\u914d\u597d\u4ee5\u4e0b\u57fa\u672c\u5b89\u5168\u63aa\u65bd\u4e4b\u95f4\uff0c\u5148\u628asshd\u670d\u52a1\u5173\u95ed\u3002<\/pre>\n<p>Step2\uff0c<span style=\"display: inline !important; float: none; background-color: transparent; color: #333333; cursor: text; font-family: 'Noto Serif',serif; font-size: 17px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;\">\u65f6\u533a\u66f4\u6539\uff0c\u952e\u76d8<\/span><span style=\"display: inline !important; float: none; background-color: transparent; color: #333333; cursor: text; font-family: 'Noto Serif',serif; font-size: 17px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;\">layout<\/span><span style=\"display: inline !important; float: none; background-color: transparent; color: #333333; cursor: text; font-family: 'Noto Serif',serif; font-size: 17px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;\">\u66f4\u6539\u3002<\/span><\/p>\n<p>centos:<\/p>\n<p>debian:<\/p>\n<p>redhat :ln -sf \/usr\/share\/zoneinfo\/Asia\/Tokyo \/etc\/localtime<\/p>\n<p><code class=\"command\">hostnamectl set-hostname xxx<\/code><\/p>\n<p>Step3\uff0c\u66f4\u6539root\u7528\u6237\u5bc6\u7801\uff0c\u8ffd\u52a0\u4e00\u822c\u7528\u6237\u3001\u5c06\u7528\u6237\u52a0\u5230wheel\u7ec4\u91cc\u3002<\/p>\n<p>root\u306elogin.defs\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6<\/p>\n<p style=\"padding-left: 90px;\">#login.defs\u306e\u6700\u5f8c\u306e2\u884c\u3002<br \/>\n#ENCRYPT_METHOD SHA512<br \/>\nSU_WHEEL_ONLY yes<\/p>\n<p style=\"padding-left: 60px;\">PAM\u306e\u8a2d\u5b9a<\/p>\n<p style=\"padding-left: 90px;\">vi \/etc\/pam.d\/su<br \/>\n#auth required pam_wheel.so use_uid<br \/>\nauth required\u00a0pam_wheel.so use_uid<\/p>\n<p>Step4\uff0c\u66f4\u6539ssh\u914d\u7f6e\u6587\u4ef6\uff0c\u505a\u597d\u5b89\u5168\u63aa\u65bd<\/p>\n<p style=\"padding-left: 60px;\">vim \/etc\/ssh\/sshd_config<br \/>\nPort 2222<br \/>\nPermitRootLogin no<\/p>\n<p style=\"padding-left: 60px;\">Match Group *,!wheel<br \/>\nChrootDirectory \/home\/%u\/.\/<\/p>\n<p style=\"padding-left: 60px;\">vim \/etc\/hosts.deny<br \/>\nsshd:all:deny<\/p>\n<p style=\"padding-left: 60px;\">vim \/etc\/hosts.allow<br \/>\nsshd:192.168.1.106:allow<\/p>\n<p><span style=\"display: inline !important; float: none; background-color: transparent; color: #333333; cursor: text; font-family: 'Noto Serif',serif; font-size: 17px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;\">Step5<\/span><span style=\"display: inline !important; float: none; background-color: transparent; color: #333333; cursor: text; font-family: 'Noto Serif',serif; font-size: 17px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;\">\uff0c\u5b89\u88c5\u53ca\u914d\u7f6e<\/span><span style=\"display: inline !important; float: none; background-color: transparent; color: #333333; cursor: text; font-family: 'Noto Serif',serif; font-size: 17px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;\">iptables<\/span><\/p>\n<p style=\"padding-left: 60px;\">https:\/\/centossrv.com\/iptables.shtml<\/p>\n<p>Step6\uff0c\u542f\u52a8sshd\u670d\u52a1\uff0c\u901a\u8fc7teraterm\u94fe\u63a5\u670d\u52a1\u5668\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Step1\uff0c\u505c\u6389sshd\u670d\u52a1 \u4e3a\u4e86\u5b89\u5168\u8d77\u89c1\uff0c\u5728\u914d\u597d\u4ee5\u4e0b\u57fa\u672c\u5b89\u5168\u63aa\u65bd\u4e4b\u95f4\uff0c\u5148\u628asshd\u670d\u52a1\u5173\u95ed\u3002 Step2\uff0c\u65f6 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[44,2],"tags":[3],"_links":{"self":[{"href":"https:\/\/vongg.com\/index.php?rest_route=\/wp\/v2\/posts\/24"}],"collection":[{"href":"https:\/\/vongg.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vongg.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vongg.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vongg.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=24"}],"version-history":[{"count":10,"href":"https:\/\/vongg.com\/index.php?rest_route=\/wp\/v2\/posts\/24\/revisions"}],"predecessor-version":[{"id":430,"href":"https:\/\/vongg.com\/index.php?rest_route=\/wp\/v2\/posts\/24\/revisions\/430"}],"wp:attachment":[{"href":"https:\/\/vongg.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=24"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vongg.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=24"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vongg.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}