{"id":52,"date":"2022-05-08T15:45:55","date_gmt":"2022-05-08T06:45:55","guid":{"rendered":"http:\/\/52.196.21.54.nip.io\/techblog\/?p=52"},"modified":"2022-05-07T16:03:07","modified_gmt":"2022-05-07T07:03:07","slug":"ubuntu-server%e3%81%a7%e3%83%95%e3%82%a1%e3%82%a4%e3%82%a2%e3%82%a6%e3%82%a9%e3%83%bc%e3%83%ab%ef%bc%88ufw%ef%bc%89%e3%82%92%e4%bd%bf%e3%81%86","status":"publish","type":"post","link":"https:\/\/shugomatsuzawa.com\/techblog\/2022\/05\/08\/52\/","title":{"rendered":"Ubuntu Server\u3067\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\uff08UFW\uff09\u3092\u4f7f\u3046"},"content":{"rendered":"\n<p>Ubuntu\u3067\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5\u306e\u5099\u5fd8\u9332\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl status ufw # \u8d77\u52d5\u78ba\u8a8d\nsudo systemctl is-active ufw # \u8d77\u52d5<\/code><\/pre>\n\n\n\n<p>ufw\u6709\u52b9\u5316\u524d\u304b\u3089\u63a5\u7d9a\u4e2d\u306e\u901a\u4fe1\u304c\u906e\u65ad\u3055\u308c\u308b\u3053\u3068\u306f\u306a\u3044\u3089\u3057\u3044\u304c\u3001\u5ff5\u306e\u70ba\u6700\u512a\u5148\u3067SSH\u306e\u8a2d\u5b9a\u3092\u3059\u308b\u3002 \u3053\u306e\u8a2d\u5b9a\u304c\u7d42\u308f\u308b\u307e\u3067\u7d76\u5bfe\u306bSSH\u63a5\u7d9a\u3092\u5207\u65ad\u3057\u306a\u3044\u3053\u3068\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ufw allow 22\/tcp comment \"SSH\"<\/code><\/pre>\n\n\n\n<p>\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u306f\u6b21\u306e\u901a\u308a\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ufw disable # \u7121\u52b9\u5316\nsudo ufw enable # \u6709\u52b9\u5316\nsudo ufw default ALLOW\u3000# \u30eb\u30fc\u30eb\u5916\u306e\u901a\u4fe1\u3092\u5168\u3066\u8a31\u53ef\uff08\u30d6\u30ed\u30c3\u30af\u30ea\u30b9\u30c8\uff09\nsudo ufw default DENY # \u30eb\u30fc\u30eb\u5916\u306e\u901a\u4fe1\u3092\u5168\u3066\u906e\u65ad\uff08\u30a2\u30ed\u30fc\u30ea\u30b9\u30c8\uff09\nsudo ufw status numbered # \u30b9\u30c6\u30fc\u30bf\u30b9\u78ba\u8a8d\uff08\u756a\u53f7\u4ed8\u304d\uff09\nsudo ufw delete &lt;\u756a\u53f7&gt; # \u8a2d\u5b9a\u524a\u9664\nsudo ufw reload # \u30ea\u30ed\u30fc\u30c9\u3057\u3066\u9069\u7528<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"Ubuntu\u3067\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5\u306e\u5099\u5fd8\u9332\u3002 ufw\u6709\u52b9\u5316\u524d\u304b\u3089\u63a5\u7d9a\u4e2d\u306e\u901a\u4fe1\u304c\u906e\u65ad\u3055\u308c\u308b\u3053\u3068\u306f\u306a\u3044\u3089\u3057\u3044\u304c\u3001\u5ff5\u306e\u70ba\u6700\u512a\u5148\u3067SSH\u306e\u8a2d\u5b9a\u3092\u3059\u308b\u3002 \u3053\u306e\u8a2d\u5b9a\u304c\u7d42\u308f\u308b\u307e\u3067\u7d76\u5bfe\u306bSSH\u63a5\u7d9a\u3092\u5207\u65ad\u3057\u306a\u3044\u3053\u3068\u3002 \u57fa\u672c\u7684\u306a\u4f7f [&hellip;]","protected":false},"author":1,"featured_media":60,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[8],"tags":[9,11,19,10],"class_list":["post-52","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-system-management","tag-linux","tag-ubuntu","tag-ufw","tag-memo"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/shugomatsuzawa.com\/techblog\/wp-content\/uploads\/sites\/3\/2022\/05\/cybersecurity-gbec52d8fe_1920.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts\/52","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/comments?post=52"}],"version-history":[{"count":2,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts\/52\/revisions"}],"predecessor-version":[{"id":61,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts\/52\/revisions\/61"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/media\/60"}],"wp:attachment":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/media?parent=52"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/categories?post=52"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/tags?post=52"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}