{"id":14061,"date":"2023-08-24T07:22:19","date_gmt":"2023-08-23T22:22:19","guid":{"rendered":"https:\/\/lab4ict.com\/system\/?p=14061"},"modified":"2023-08-25T06:30:57","modified_gmt":"2023-08-24T21:30:57","slug":"ufw%e3%81%ae%e5%9f%ba%e6%9c%ac%e6%93%8d%e4%bd%9c%e3%82%92%e3%81%be%e3%81%a8%e3%82%81%e3%82%8b%ef%bc%81","status":"publish","type":"post","link":"https:\/\/lab4ict.com\/system\/archives\/14061","title":{"rendered":"Ufw\u306e\u57fa\u672c\u64cd\u4f5c\u3092\u307e\u3068\u3081\u308b\uff01"},"content":{"rendered":"<p>Ufw\u306e\u57fa\u672c\u64cd\u4f5c\u3092\u307e\u3068\u3081\u307e\u3059\u3002<br \/>\n<!--more--><\/p>\n<h2>\u52d5\u4f5c\u78ba\u8a8d\u3057\u305f\u74b0\u5883\u3092\u78ba\u8a8d\u3059\u308b\uff01<\/h2>\n<p>\u52d5\u4f5c\u78ba\u8a8d\u3057\u305f\u74b0\u5883\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ hostnamectl\r\n Static hostname: vmswps01\r\n       Icon name: computer-vm\r\n         Chassis: vm\r\n      Machine ID: 71bb07e8b0b241a7b80c0ffc45302ee2\r\n         Boot ID: 1c27ae48bdb341c38d9181dabb3a2bc3\r\n  Virtualization: oracle\r\nOperating System: Ubuntu 22.04.2 LTS              \r\n          Kernel: Linux 5.15.0-78-generic\r\n    Architecture: x86-64\r\n Hardware Vendor: innotek GmbH\r\n  Hardware Model: VirtualBox\r\n<\/pre>\n<h2>Ufw\u306e\u30b5\u30fc\u30d3\u30b9\u306e\u8d77\u52d5\u72b6\u6cc1\u3092\u78ba\u8a8d\u3059\u308b\uff01<\/h2>\n<p>Ufw\u306e\u30b5\u30fc\u30d3\u30b9\u306e\u8d77\u52d5\u72b6\u6cc1\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ systemctl status ufw\r\n\u25cf ufw.service - Uncomplicated firewall\r\n     Loaded: loaded (\/lib\/systemd\/system\/ufw.service; enabled; vendor preset: enabled)\r\n     Active: active (exited) since Wed 2023-08-23 21:40:17 UTC; 17min ago\r\n       Docs: man:ufw(8)\r\n    Process: 575 ExecStart=\/lib\/ufw\/ufw-init start quiet (code=exited, status=0\/SUCCESS)\r\n   Main PID: 575 (code=exited, status=0\/SUCCESS)\r\n        CPU: 1ms\r\n<\/pre>\n<h2>Ufw\u306e\u30b5\u30fc\u30d3\u30b9\u3092\u7121\u52b9\u5316\u3059\u308b\uff01<\/h2>\n<p>Ufw\u306e\u30b5\u30fc\u30d3\u30b9\u3092\u7121\u52b9\u5316\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,4]; title: ; notranslate\" title=\"\">\r\n$ sudo systemctl disable --now ufw\r\nSynchronizing state of ufw.service with SysV service script with \/lib\/systemd\/systemd-sysv-install.\r\nExecuting: \/lib\/systemd\/systemd-sysv-install disable ufw\r\n$ systemctl status ufw\r\n\u25cb ufw.service - Uncomplicated firewall\r\n     Loaded: loaded (\/lib\/systemd\/system\/ufw.service; disabled; vendor preset: enabled)\r\n     Active: inactive (dead)\r\n       Docs: man:ufw(8)\r\n<\/pre>\n<h2>Ufw\u306e\u30b5\u30fc\u30d3\u30b9\u3092\u6709\u52b9\u5316\u3059\u308b\uff01<\/h2>\n<p>Ufw\u306e\u30b5\u30fc\u30d3\u30b9\u3092\u6709\u52b9\u5316\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,4]; title: ; notranslate\" title=\"\">\r\n$ sudo systemctl enable --now ufw\r\nSynchronizing state of ufw.service with SysV service script with \/lib\/systemd\/systemd-sysv-install.\r\nExecuting: \/lib\/systemd\/systemd-sysv-install enable ufw\r\n$ systemctl status ufw\r\n\u25cf ufw.service - Uncomplicated firewall\r\n     Loaded: loaded (\/lib\/systemd\/system\/ufw.service; enabled; vendor preset: enabled)\r\n     Active: active (exited) since Wed 2023-08-23 22:01:49 UTC; 1s ago\r\n       Docs: man:ufw(8)\r\n    Process: 1639 ExecStart=\/lib\/ufw\/ufw-init start quiet (code=exited, status=0\/SUCCESS)\r\n   Main PID: 1639 (code=exited, status=0\/SUCCESS)\r\n        CPU: 944us\r\n<\/pre>\n<h2>Ufw\u306e\u901a\u4fe1\u5236\u5fa1\u6a5f\u80fd\u306e\u72b6\u614b\u3092\u78ba\u8a8d\u3059\u308b\uff01<\/h2>\n<p>Ufw\u306e\u901a\u4fe1\u5236\u5fa1\u6a5f\u80fd\u306e\u72b6\u614b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo ufw status\r\nStatus: inactive\r\n<\/pre>\n<h2>Ufw\u306e\u901a\u4fe1\u5236\u5fa1\u6a5f\u80fd\u3092\u6709\u52b9\u5316\u3059\u308b\uff01<\/h2>\n<p>Ufw\u306e\u901a\u4fe1\u5236\u5fa1\u6a5f\u80fd\u3092\u6709\u52b9\u5316\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,4]; title: ; notranslate\" title=\"\">\r\n$ sudo ufw enable\r\nCommand may disrupt existing ssh connections. Proceed with operation (y|n)?  y\r\nFirewall is active and enabled on system startup\r\n$ sudo ufw status\r\nStatus: active\r\n<\/pre>\n<h2>Ufw\u306e\u901a\u4fe1\u5236\u5fa1\u6a5f\u80fd\u3092\u7121\u52b9\u5316\u3059\u308b\uff01<\/h2>\n<p>Ufw\u306e\u901a\u4fe1\u5236\u5fa1\u6a5f\u80fd\u3092\u7121\u52b9\u5316\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,3]; title: ; notranslate\" title=\"\">\r\n$ sudo ufw disable\r\nFirewall stopped and disabled on system startup\r\n$ sudo ufw status\r\nStatus: inactive\r\n<\/pre>\n<h2>\u901a\u4fe1\u5236\u5fa1\u306e\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3059\u308b\uff01<\/h2>\n<p>\u901a\u4fe1\u5236\u5fa1\u306e\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,4,6,9]; title: ; notranslate\" title=\"\">\r\n$ sudo ufw allow 22\r\nRules updated\r\nRules updated (v6)\r\n$ sudo ufw status\r\nStatus: inactive\r\n$ sudo ufw enable\r\nCommand may disrupt existing ssh connections. Proceed with operation (y|n)? y\r\nFirewall is active and enabled on system startup\r\n$ sudo ufw status\r\nStatus: active\r\n\r\nTo                         Action      From\r\n--                         ------      ----\r\n22                         ALLOW       Anywhere                  \r\n22 (v6)                    ALLOW       Anywhere (v6)             \r\n<\/pre>\n<h2>\u901a\u4fe1\u5236\u5fa1\u306e\u8a2d\u5b9a\u3092\u524a\u9664\u3059\u308b\uff01<\/h2>\n<p>\u901a\u4fe1\u5236\u5fa1\u306e\u8a2d\u5b9a\u3092\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,4]; title: ; notranslate\" title=\"\">\r\n$ sudo ufw delete allow 22\r\nRule deleted\r\nRule deleted (v6)\r\n$ sudo ufw status\r\nStatus: active\r\n<\/pre>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>Ufw\u306e\u57fa\u672c\u64cd\u4f5c\u3092\u307e\u3068\u3081\u307e\u3057\u305f\u3002<\/p>\n<h2>\u53c2\u8003\u60c5\u5831<\/h2>\n<ul>\n<li><a href=\"https:\/\/ubuntu.com\/server\/docs\/security-firewall\" rel=\"noopener\" target=\"_blank\">Ubuntu - Security Firewall<\/a><\/li>\n<\/ul>\n<h2>\u95a2\u9023\u8a18\u4e8b<\/h2>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/14155\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Ubuntu\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u6a5f\u80fd\u3092\u4f7f\u3044\u3053\u306a\u3059\uff01\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2022\/04\/fi_ubuntu_01-150x150.png\" class=\"lazyload\"><\/div><div class=\"title\">\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Ubuntu\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u6a5f\u80fd\u3092\u4f7f\u3044\u3053\u306a\u3059\uff01<\/div><div class=\"substr\">Ubuntu\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u6a5f\u80fd\u3092\u4f7f\u3044\u3053\u306a\u3059\u305f\u3081\u306b\u5fc5\u8981\u3068\u306a\u308b\u8a18\u4e8b\u4e00\u89a7\u3092\u63b2\u8f09\u3057\u307e\u3059\u3002...<\/div><\/a><\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ufw\u306e\u57fa\u672c\u64cd\u4f5c\u3092\u307e\u3068\u3081\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":5284,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[933],"tags":[282,51,951,32,950,891],"class_list":["post-14061","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu-security","tag-linux","tag-ubuntu","tag-ufw","tag-32","tag-950","tag-891"],"_links":{"self":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/14061","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/comments?post=14061"}],"version-history":[{"count":13,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/14061\/revisions"}],"predecessor-version":[{"id":14159,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/14061\/revisions\/14159"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media\/5284"}],"wp:attachment":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media?parent=14061"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/categories?post=14061"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/tags?post=14061"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}