{"id":28873,"date":"2020-02-09T08:30:54","date_gmt":"2020-02-09T00:30:54","guid":{"rendered":"http:\/\/4563.org\/?p=28873"},"modified":"2020-02-09T08:30:54","modified_gmt":"2020-02-09T00:30:54","slug":"%e4%b8%80%e9%94%ae%e8%ae%be%e7%bd%aecentos7-%e8%af%81%e4%b9%a6%e7%99%bb%e9%99%86%e7%9a%84%e8%84%9a%e6%9c%ac","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=28873","title":{"rendered":"\u4e00\u952e\u8bbe\u7f6ecentos7+ \u8bc1\u4e66\u767b\u9646\u7684\u811a\u672c"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>Eric.c<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-4 21:03:10\t<\/p>\n<h3>\u4e00\u952e\u8bbe\u7f6ecentos7+ \u8bc1\u4e66\u767b\u9646\u7684\u811a\u672c<\/h3>\n<p>  \t\t \u672c\u5e16\u6700\u540e\u7531 Eric.c \u4e8e 2020-1-4 21:39 \u7f16\u8f91 <\/p>\n<p> \u8fd9\u73a9\u610f\u6bcf\u4e2a\u4eba\u7684\u516c\u94a5\u90fd\u4e0d\u4e00\u6837\uff0c\u59cb\u7ec8\u5f97\u6539\u6587\u4ef6\u624d\u80fd\u591a\u673a\u5668\u64cd\u4f5c\u3002\u6240\u4ee5\u4e0d\u641e\u90a3\u4e48\u590d\u6742\u7684\u4ea4\u4e92\u7b49\u3002\u6bcf\u4e2a\u4eba\u8981\u7528\u7684\u90fd\u4fee\u6539\u4e00\u4efd\u81ea\u5df1\u7684<\/p>\n<p>  \u4e00\u952e\u8bbe\u7f6ecentos7\u8bc1\u4e66\u767b\u9646\u7684\u811a\u672c<\/p>\n<p>  ##\u4f7f\u7528\u524d\u63d0\uff1a \u4f60\u9700\u8981\u63d0\u524d\u51c6\u5907\u597d\u4f60\u7684\u516c\u94a5\u6587\u672c<\/p>\n<p>  \u5ba2\u6237\u7aef\u662fwindow\u7cfb\u7edf\uff0c\u53ef\u4ee5\u4f7f\u7528putty\u7684\u5de5\u5177\u751f\u6210\u8bc1\u4e66\u5bf9\uff0c\u83b7\u53d6id_ras.pub \u8fd9\u4e2a\u516c\u94a5\u5185\u5bb9\u3002 \u7528\u6587\u672c\u5de5\u5177\u6253\u5f00\u8fd9\u4e2a\u6587\u4ef6\uff0c\u62f7\u8d1d\u5373\u53ef\u3002<\/p>\n<p>  \u5ba2\u6237\u7aef\u662fmac \u3001 linux\u7cfb\u7edf\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u751f\u6210\u8bc1\u4e66\u5bf9<\/p>\n<p>  ssh-keygen -t rsa<br \/>  \u4f1a\u63d0\u793a\u8f93\u5165\uff1a\u5bc6\u94a5\u5b58\u653e\u4f4d\u7f6e\uff08\u76f4\u63a5\u56de\u8f66\uff0c\u9ed8\u8ba4\u5728\/home\/\u7528\u6237\u540d\/.ssh\/\u76ee\u5f55\uff09\u3001\u5bc6\u7801\u77ed\u8bed\u3001\u91cd\u590d\u5bc6\u7801\u77ed\u8bed\u3002 \u5b8c\u6210\u540e\u5728\/home\/\u7528\u6237\u540d\/.ssh\/\u76ee\u5f55\u4e0b\u751f\u6210\u4e862\u4e2a\u6587\u4ef6\uff1aid_rsa\u4e3a\u79c1\u94a5\uff0cid_rsa.pub\u4e3a\u516c\u94a5\u3002<\/p>\n<p>  \u53ef\u4ee5\u6267\u884c<\/p>\n<p>  cat \/home\/\u7528\u6237\u540d\/.ssh\/id_rsa.pub <br \/>  \u5f97\u5230\u516c\u94a5\u7684\u6587\u672c<\/p>\n<p>  ##\u4f7f\u7528\u65b9\u6cd5\uff1a \u7f16\u8f91login.sh\u6587\u4ef6\u91cc\u9762\u7684xxxx\u90e8\u5206\uff0c\u6539\u6210\u4f60\u521a\u5f97\u5230\u7684\u5185\u5bb9\u3002 \u7136\u540e\u5c06\u6587\u4ef6\u4f20\u5230\u670d\u52a1\u5668\u4e0a\u53bb\uff0c\u624b\u52a8\u6267\u884c chmod +x login.sh &amp;&amp; .\/login.sh \u5373\u53ef\u5b8c\u6210\u8bbe\u7f6e<\/p>\n<p>  #\u5efa\u8bae\u5927\u5bb6\u5b58\u4e3a\u81ea\u5df1\u7684\u4e00\u4e2a\u811a\u672c\uff0c\u8fd9\u6837\u4e0d\u7528\u6bcf\u6b21\u90fd\u8bbe\u7f6e\u3002<\/p>\n<p>  Ref\uff1a https:\/\/github.com\/mallka\/sshLoginByCertFile<\/p>\n<p>  \u811a\u672c\uff1a<br \/>  #!\/usr\/bin\/env bash<\/p>\n<p>  mkdir -p \/root\/.ssh &amp;&amp; chmod 600 \/root\/.ssh &amp;&amp; echo &quot;\u6362\u6210\u4f60\u7684\u516c\u94a5\u5185\u5bb9&quot; &gt; \/root\/.ssh\/authorized_keys &amp;&amp; chmod 700 \/root\/.ssh\/authorized_keys<\/p>\n<p>   #\u542f\u7528\u8bc1\u4e66\u767b\u9646<br \/>  sed -i &#8216;s:#AuthorizedKeysFile:AuthorizedKeysFile:&#8217;\/etc\/ssh\/sshd_config<br \/>  sed -i &#8216;s\/#PasswordAuthentication\/PasswordAuthentication\/&#8217;\/etc\/ssh\/sshd_config<\/p>\n<p>  #\u4ee5\u4e0b\u4e24\u9879\u4e0d\u4e00\u5b9a\u6709\uff0c\u6709\u5c31\u5904\u7406\uff0c\u4e5f\u662f\u8bc1\u4e66\u767b\u9646\u5185\u5bb9<br \/>  sed -i &#8216;s\/#RSAAuthentication yes\/RSAAuthentication yes\/&#8217;\/etc\/ssh\/sshd_config<br \/>  sed -i &#8216;s\/#StrictModes no\/StrictModes no\/&#8217;\/etc\/ssh\/sshd_config<\/p>\n<p>  #\u5982\u679c\u8981\u6539\u7aef\u53e3\uff0c\u52a0\u5165\u4ee5\u4e0b\u8fd9\u884c<br \/>  sed -i &#8216;s\/Port 22\/Port 2121\/&#8217; \/etc\/ssh\/sshd_config&nbsp; &nbsp;<\/p>\n<p>  systemctl restart sshd.service<\/p>\n<p>  \t\t\t\t\t<strong>yfans<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-4 21:29:23\t<\/p>\n<h3><\/h3>\n<p>  \t\tyc007t\u53ef\u4ee5\u987a\u4fbf\u4fee\u6539\u4e0b\u7aef\u53e3<br \/>  sed -i &#8216;s\/#Port 22\/Port 2121\/&#8217; \/etc\/ssh\/sshd_config\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>312633180<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-4 21:51:36\t<\/p>\n<h3><\/h3>\n<p>  \t\t:lol \u6b63\u6709\u9700\u6c42\u3002\u8c22\u8c22\u5927\u4f6c\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Eric.c \u5927\u4f6c\u6709\u8bdd\u8bf4 : 20&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/28873"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=28873"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/28873\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=28873"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=28873"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=28873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}