{"id":11191,"date":"2022-05-01T03:48:47","date_gmt":"2022-04-30T18:48:47","guid":{"rendered":"http:\/\/www.webcyou.com\/?p=11191"},"modified":"2022-05-02T16:37:05","modified_gmt":"2022-05-02T07:37:05","slug":"ubuntu-20-04-lts-%e3%82%b5%e3%83%bc%e3%83%90%e6%a7%8b%e7%af%89-%e5%88%9d%e6%9c%9f%e3%82%bb%e3%83%83%e3%83%88%e3%82%a2%e3%83%83%e3%83%97","status":"publish","type":"post","link":"https:\/\/www.webcyou.com\/?p=11191","title":{"rendered":"Ubuntu 20.04 LTS \u30b5\u30fc\u30d0\u69cb\u7bc9 &#8211; \u521d\u671f\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7"},"content":{"rendered":"<p>VPS\u30b5\u30fc\u30d0\u306a\u3069\u30ec\u30f3\u30bf\u30eb\u3067\u4f7f\u7528\u3059\u308b\u306b\u3042\u305f\u3063\u3066\u3001Ubuntu 20.04\u30b5\u30fc\u30d0\u3092\u69cb\u7bc9\u3059\u308b\u305f\u3081\u306e\u30b9\u30c6\u30c3\u30d7\u3092\u6700\u5c0f\u9650\u3067\u69cb\u7bc9\u3067\u304d\u308b\u3088\u3046\u306b\u307e\u3068\u3081\u307e\u3057\u305f\u3002<\/p>\n<p>\u500b\u4eba\u7684\u306b\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u6700\u5c0f\u9650\u3067\u3001nginx\u3001Let\u2019s Encrypt\u306a\u3069\u8a2d\u5b9a\u3057TLS\u5316\u3055\u308c\u305fweb\u30b5\u30fc\u30d0\u30fc\u69cb\u7bc9<\/p>\n<p>Postfix\u3001Dovecot\u306a\u3069\u8a2d\u5b9a\u3092\u884c\u3044Gmail\u306a\u3069\u306b\u3082\u9001\u4fe1\u3067\u304d\u308b\u30bb\u30ad\u30e5\u30a2\u306a\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u69cb\u7bc9\u307e\u3067\u304c\u30b4\u30fc\u30eb\u3067\u3059\u3002\u5404\u30b3\u30de\u30f3\u30c9\u3001\u30c4\u30fc\u30eb\u306e\u8a73\u7d30\u306f\u7701\u7565\u3055\u305b\u3066\u3044\u305f\u3060\u304d\u3001\u30b3\u30de\u30f3\u30c9\u3001\u8a2d\u5b9a\u4e2d\u5fc3\u306b\u8a18\u8f09\u3057\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p>DigitalOcean\u3084conoha\u306a\u3069VPS\u30b5\u30fc\u30d0\u3092\u30ec\u30f3\u30bf\u30eb\u6642\u306bUbuntu 20.04 LTS\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u308b\u306e\u3067\u3001VPS\u30b5\u30fc\u30d0\u3092\u30ec\u30f3\u30bf\u30eb\u3057Ubuntu 20.04 LTS\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u8a2d\u5b9a\u3057\u3066\u3044\u304f\u60f3\u5b9a\u3067\u9032\u3081\u307e\u3059\u3002<\/p>\n<p>\u74b0\u5883<\/p>\n<ul>\n<li>OS Ubuntu 20.04 LTS<\/li>\n<\/ul>\n<h4>\u30e1\u30cb\u30e5\u30fc<\/h4>\n<ul>\n<li><a href=\"https:\/\/www.webcyou.com\/?p=11191\">Ubuntu 20.04 LTS \u30b5\u30fc\u30d0\u69cb\u7bc9 \u2013 \u521d\u671f\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<\/a><\/li>\n<li><a href=\"https:\/\/www.webcyou.com\/?p=11197\">Ubuntu 20.04 LTS \u30b5\u30fc\u30d0\u69cb\u7bc9 \u2013 Nginx\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a><\/li>\n<li><a href=\"https:\/\/www.webcyou.com\/?p=11205\">Ubuntu 20.04 LTS \u30b5\u30fc\u30d0\u69cb\u7bc9 \u2013 Let\u2019s Encrypt\u3067SSL\/TLS\u5316<\/a><\/li>\n<li><a href=\"https:\/\/www.webcyou.com\/?p=11211\">Ubuntu 20.04 LTS \u30b5\u30fc\u30d0\u69cb\u7bc9 \u2013 Postfix\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a><\/li>\n<li><a href=\"https:\/\/www.webcyou.com\/?p=11218\">Ubuntu 20.04 LTS \u30b5\u30fc\u30d0\u69cb\u7bc9 \u2013 Dovecot\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a><\/li>\n<li><a href=\"https:\/\/www.webcyou.com\/?p=11221\">Ubuntu 20.04 LTS \u30b5\u30fc\u30d0\u69cb\u7bc9 \u2013 Postfix SASL\u8a8d\u8a3c<\/a><\/li>\n<li><a href=\"https:\/\/www.webcyou.com\/?p=11230\">Ubuntu 20.04 LTS \u30b5\u30fc\u30d0\u69cb\u7bc9 \u2013 Postfix Let\u2019s Encrypt\u3067TLS\u5316<\/a><\/li>\n<li><a href=\"https:\/\/www.webcyou.com\/?p=11234\">Ubuntu 20.04 LTS \u30b5\u30fc\u30d0\u69cb\u7bc9 \u2013 DKIM\u3001DMARC\u3092\u8a2d\u5b9a\u3059\u308b<\/a><\/li>\n<\/ul>\n<h4>\u30e6\u30fc\u30b6\u30fc\u306e\u4f5c\u6210<\/h4>\n<p>root\u30e6\u30fc\u30b6\u30fc\u3068\u3057\u3066ssh\u63a5\u7d9a\u3057\u3066\u3001\u30b5\u30fc\u30d0\u30fc\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u307e\u3059\u3002<\/p>\n<p>your_server_ip\u306f\u3001\u30d1\u30d6\u30ea\u30c3\u30afIP\u30a2\u30c9\u30ec\u30b9\u3082\u3057\u304f\u306f\u3001\u53d6\u5f97\u3057\u305f\u30c9\u30e1\u30a4\u30f3\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ ssh root@your_server_ip<\/pre>\n<p>&nbsp;<\/p>\n<p>\u30d1\u30b9\u30ef\u30fc\u30c9\u8a8d\u8a3c\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u305f\u3081\u306e<strong>root<\/strong>\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<p><strong>root<\/strong>\u30e6\u30fc\u30b6\u30fc\u306f\u3001Linux\u74b0\u5883\u3067\u306f\u975e\u5e38\u306b\u5e45\u5e83\u3044\u6a29\u9650\u3092\u6301\u3064\u7ba1\u7406\u8005\u30e6\u30fc\u30b6\u30fc\u306a\u306e\u3067\u3001\u65b0\u3057\u304f\u30e6\u30fc\u30b6\u30fc\u4f5c\u6210\u3057\u3001\u305d\u3061\u3089\u3092\u5229\u7528\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3068\u3057\u3066\u3001webapp\u3068\u547c\u3070\u308c\u308b\u65b0\u3057\u3044\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\uff08\u30e6\u30fc\u30b6\u30fc\u540d\u306f\u4efb\u610f\uff09<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\"># adduser webapp<\/pre>\n<p>\u3044\u304f\u3064\u304b\u8cea\u554f\u3055\u308c\u307e\u3059\u304c\u3001\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u304b\u3089\u5165\u529b\u3002\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u8ffd\u52a0\u60c5\u5831\u3092\u5165\u529b\u3057\u307e\u3059\u3002\u4efb\u610f\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306fENTER\u30ad\u30fc\u3067\u30b9\u30ad\u30c3\u30d7\u53ef\u80fd\u3002<\/p>\n<p>&nbsp;<\/p>\n<h4>\u7ba1\u7406\u6a29\u9650\u3092\u4ed8\u4e0e<\/h4>\n<p>\u5148\u307b\u3069\u4f5c\u6210\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u304csudo\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u51fa\u6765\u308b\u69d8\u306bsudo \u30b0\u30eb\u30fc\u30d7\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\"># usermod -aG sudo webapp<\/pre>\n<h4>\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u306e\u8a2d\u5b9a<\/h4>\n<p><strong>UFW \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u4e00\u89a7\u78ba\u8a8d<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\"># ufw app list<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">Output\r\nAvailable applications:\r\nOpenSSH<\/pre>\n<p>\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb SSH\u63a5\u7d9a\u3092\u8a31\u53ef<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\"># ufw allow OpenSSH<\/pre>\n<p>\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u3092\u6709\u52b9<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\"># ufw enable<\/pre>\n<p>y\u3068\u5165\u529b\u3057\u3066\u304b\u3089\u3001ENTER<\/p>\n<p>&nbsp;<\/p>\n<p><strong>\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u72b6\u614b\u78ba\u8a8d<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\"># ufw status<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">Output\r\nStatus: active\r\n\r\nTo Action From\r\n-- ------ ----\r\nOpenSSH ALLOW Anywhere\r\nOpenSSH (v6) ALLOW Anywhere (v6)<\/pre>\n<h4>\u901a\u5e38\u30e6\u30fc\u30b6\u30fc\u306e\u5916\u90e8\u30a2\u30af\u30bb\u30b9\u3092\u6709\u52b9\u5316<\/h4>\n<p>\u65e5\u5e38\u7684\u306b\u5229\u7528\u3059\u308b\u901a\u5e38\u30e6\u30fc\u30b6\u30fc\u304cSSH\u63a5\u7d9a\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<br \/>\nroot\u30a2\u30ab\u30a6\u30f3\u30c8\u304c\u30d1\u30b9\u30ef\u30fc\u30c9\u8a8d\u8a3c\u306e\u5834\u5408\u3068\u3001SSH\u306e\u9375\u8a8d\u8a3c\u3092\u884c\u3063\u3066\u3044\u308b\u5834\u5408\u3067\u63a5\u7d9a\u304c\u7570\u306a\u308a\u307e\u3059\u3002<\/p>\n<h5>\u30d1\u30b9\u30ef\u30fc\u30c9\u8a8d\u8a3c\u306e\u5834\u5408<\/h5>\n<p>SSH\u3092\u8a66\u307f\u308b\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u6c42\u3081\u3089\u308c\u308b\u306e\u3067\u5165\u529b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ ssh webapp@your_server_ip<\/pre>\n<p>\u30ed\u30b0\u30a4\u30f3\u5f8c\u3001sudo\u30b3\u30de\u30f3\u30c9\u306f\u30bb\u30c3\u30b7\u30e7\u30f3\u3054\u3068\u306b\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u5fc5\u8981\u3068\u306a\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ sudo command_to_run<\/pre>\n<p>\u30d1\u30b9\u30ef\u30fc\u30c9\u3067\u306e\u8a8d\u8a3c\u306f\u8a31\u53ef\u3057\u306a\u3044\u5f62\u304c\u671b\u307e\u3057\u3044\u3002<\/p>\n<p>DigitalOcean\u306eDrop\u306a\u3069\u306f\u521d\u671f\u3067\u8a31\u53ef\u3055\u308c\u3066\u3044\u306a\u3044\u69d8\u5b50\u3002<\/p>\n<h5>SSH\u306e\u9375\u8a8d\u8a3c\u306e\u5834\u5408<\/h5>\n<p>root\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u30b5\u30fc\u30d0\u30fc\u4e0a\u306e\u30ed\u30fc\u30ab\u30eb\u516c\u958b\u9375\u306e\u30b3\u30d4\u30fc\u3092\u4f5c\u6210\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u306e~\/.ssh\/authorized_keys\u30d5\u30a1\u30a4\u30eb\u306b\u8ffd\u52a0\u3059\u308b\u305f\u3081\u3001rsync\u30b3\u30de\u30f3\u30c9\u3092\u7528\u3044\u3066.ssh\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4e38\u3054\u3068\u30b3\u30d4\u30fc\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\"># rsync --archive --chown=webapp:webapp ~\/.ssh \/home\/webapp<\/pre>\n<p>\u65b0\u898f\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u7acb\u3061\u4e0a\u3052\u3001\u4f5c\u6210\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u540d\u3067SSH\u3092\u4f7f\u7528\u3057\u3066\u63a5\u7d9a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ ssh webapp@your_server_ip<\/pre>\n<p>\u30bb\u30c3\u30b7\u30e7\u30f3\u3054\u3068\u306b\u521d\u3081\u3066sudo\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001\u901a\u5e38\u30e6\u30fc\u30b6\u30fc\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u5fc5\u8981\uff08\u4ee5\u964d\u306f\u5b9a\u671f\u7684\u306b\u5fc5\u8981\uff09\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ sudo command_to_run<\/pre>\n<h4>DNS\u30ec\u30b3\u30fc\u30c9\u8a2d\u5b9a<\/h4>\n<p>\u304a\u540d\u524d\u30c9\u30c3\u30c8\u30b3\u30e0\u306a\u3069\u3067\u30c9\u30e1\u30a4\u30f3\u53d6\u5f97\u3057\u3066\u3044\u308c\u3070\u3001<\/p>\n<p>example.com \u3068\u3001www.example.com \u3092\u6301\u3064A\u30ec\u30b3\u30fc\u30c9 \u3068\u3057\u3066\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306eDNS\u30ec\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0<\/p>\n<table>\n<tbody>\n<tr>\n<th>\u30bf\u30a4\u30d7<\/th>\n<th>\u540d\u79f0<\/th>\n<th>TTL<\/th>\n<th>\u5024<\/th>\n<\/tr>\n<tr>\n<td>A(\u901a\u5e38)<\/td>\n<td>@<\/td>\n<td>3600<\/td>\n<td>(VPS\u306eIP\u30a2\u30c9\u30ec\u30b9)<\/td>\n<\/tr>\n<tr>\n<td>A(\u901a\u5e38)<\/td>\n<td>www<\/td>\n<td>3600<\/td>\n<td>(VPS\u306eIP\u30a2\u30c9\u30ec\u30b9)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u7d9a\u3044\u3066\u3001Nginx\u306e\u8a2d\u5b9a\u3092\u884c\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.webcyou.com\/?p=11197\">Ubuntu 20.04 LTS \u30b5\u30fc\u30d0\u69cb\u7bc9 \u2013 Nginx\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a><br \/>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>VPS\u30b5\u30fc\u30d0\u306a\u3069\u30ec\u30f3\u30bf\u30eb\u3067\u4f7f\u7528\u3059\u308b\u306b\u3042\u305f\u3063\u3066\u3001Ubuntu 20.04\u30b5\u30fc\u30d0\u3092\u69cb\u7bc9\u3059\u308b\u305f\u3081\u306e\u30b9\u30c6\u30c3\u30d7\u3092\u6700\u5c0f\u9650\u3067\u69cb\u7bc9\u3067\u304d\u308b\u3088\u3046\u306b\u307e\u3068\u3081\u307e\u3057\u305f\u3002 \u500b\u4eba\u7684\u306b\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u6700\u5c0f\u9650\u3067\u3001nginx\u3001Let\u2019s Encrypt\u306a\u3069\u8a2d\u5b9a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":11192,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[248],"tags":[221,44,45,293],"class_list":{"0":"post-11191","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","6":"hentry","7":"category-ubuntu","8":"tag-linux","9":"tag-web","11":"tag-293"},"_links":{"self":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/11191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11191"}],"version-history":[{"count":8,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/11191\/revisions"}],"predecessor-version":[{"id":11258,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/11191\/revisions\/11258"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/media\/11192"}],"wp:attachment":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}