{"id":58,"date":"2020-05-20T11:54:35","date_gmt":"2020-05-20T03:54:35","guid":{"rendered":"https:\/\/blog.linsakura.com\/?p=58"},"modified":"2020-05-20T14:20:32","modified_gmt":"2020-05-20T06:20:32","slug":"use-ssh-as-root","status":"publish","type":"post","link":"https:\/\/blog.linsakura.com\/index.php\/2020\/05\/20\/use-ssh-as-root\/","title":{"rendered":"\u542f\u7528root\u8d26\u6237\u8fde\u63a5ssh"},"content":{"rendered":"<p>[title]\u5b89\u88c5ssh\u670d\u52a1[\/title]<br \/>\n\u5982\u679c\u975eroot\u8d26\u6237\uff0c\u8bf7\u5728\u547d\u4ee4\u524d\u52a0sudo<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">\r\napt-get install openssh-server\r\n<\/pre>\n<p>[title]\u5b89\u88c5\u9632\u706b\u5899\u5e76\u542f\u752822\u7aef\u53e3[\/title]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">\r\napt-get install ufw\r\nufw enable\r\nufw allow 22\r\n#\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b22\u7aef\u53e3\u72b6\u6001\uff0cLISTEN\u5373\u4e3a\u5f00\u542f\u72b6\u6001\r\nlsof -i:22\r\nnetstat -ntlp|grep 22\r\n<\/pre>\n<p>[title]\u5141\u8bb8root\u8d26\u6237\u5bc6\u7801ssh\u767b\u5f55[\/title]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">\r\nvi \/etc\/ssh\/sshd_config\r\n<\/pre>\n<p>\u5c06\u4e0b\u9762\u884c\u6ce8\u91ca\uff1a<br \/>\n<code>PermitRootLogin prohibit-password<\/code>   #\u5141\u8bb8root\u767b\u5f55\uff0c\u4f46\u662f\u7981\u6b62root\u7528\u5bc6\u7801\u767b\u5f55<br \/>\n\u65b0\u589e\u4e00\u884c\uff1a<br \/>\n<code>PermitRootLogin yes<\/code>   #\u5141\u8bb8root\u4f7f\u7528\u5bc6\u7801\u767b\u5f55<br \/>\n\u91cd\u542fssh\u670d\u52a1<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">\r\nservice ssh restart\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>[title]\u5b89\u88c5ssh\u670d\u52a1[\/title] \u5982\u679c\u975eroot\u8d26\u6237\uff0c\u8bf7\u5728\u547d\u4ee4\u524d\u52a0sudo apt-get install openssh-server [title]\u5b89\u88c5\u9632\u706b\u5899\u5e76\u542f\u752822\u7aef\u53e3[\/title] apt-get install ufw ufw enable ufw allow 22 #\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b22\u7aef\u53e3\u72b6\u6001\uff0cLISTEN\u5373\u4e3a\u5f00\u542f\u72b6\u6001 lsof -i:22 netstat -ntlp [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,6],"tags":[21],"class_list":["post-58","post","type-post","status-publish","format-standard","hentry","category-dev","category-linux","tag-ssh"],"_links":{"self":[{"href":"https:\/\/blog.linsakura.com\/index.php\/wp-json\/wp\/v2\/posts\/58","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.linsakura.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.linsakura.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.linsakura.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.linsakura.com\/index.php\/wp-json\/wp\/v2\/comments?post=58"}],"version-history":[{"count":1,"href":"https:\/\/blog.linsakura.com\/index.php\/wp-json\/wp\/v2\/posts\/58\/revisions"}],"predecessor-version":[{"id":59,"href":"https:\/\/blog.linsakura.com\/index.php\/wp-json\/wp\/v2\/posts\/58\/revisions\/59"}],"wp:attachment":[{"href":"https:\/\/blog.linsakura.com\/index.php\/wp-json\/wp\/v2\/media?parent=58"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.linsakura.com\/index.php\/wp-json\/wp\/v2\/categories?post=58"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.linsakura.com\/index.php\/wp-json\/wp\/v2\/tags?post=58"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}