{"id":3262,"date":"2021-06-06T07:55:59","date_gmt":"2021-06-05T22:55:59","guid":{"rendered":"https:\/\/ecpplus.net\/weblog\/?p=3262"},"modified":"2021-06-10T16:52:34","modified_gmt":"2021-06-10T07:52:34","slug":"motd","status":"publish","type":"post","link":"https:\/\/ecpplus.net\/weblog\/motd\/","title":{"rendered":"motd \u3067 ssh \u3057\u305f\u76f4\u5f8c\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b"},"content":{"rendered":"<p>Linux \u306e <a target=\"_blank\" href=\"https:\/\/en.wikipedia.org\/wiki\/Motd_(Unix)\" rel=\"noreferrer noopener\">motd<\/a> (message of the day) \u3092\u4f7f\u3063\u3066\u3001 ssh \u3057\u305f\u76f4\u5f8c\u306b\u6a19\u6e96\u51fa\u529b\u3059\u308b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u51fa\u6765\u308b\u3002<\/p>\n<p>motd \u3067\u306f\u3001\u4efb\u610f\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u306a\u306e\u3067\u3001\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u66f8\u3044\u305f\u308a Ruby \u3067\u66f8\u3044\u305f\u308a(\u591a\u5206\u30d0\u30a4\u30ca\u30ea\u3067\u3082OK)\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3060\u3002<\/p>\n<p>SSH \u3057\u305f\u30b5\u30fc\u30d0\u304c\u4f55\u306e\u76ee\u7684\u306e\u30b5\u30fc\u30d0\u306a\u306e\u304b\u8868\u793a\u3055\u305b\u305f\u308a\u3001\u73fe\u5728\u30c7\u30d7\u30ed\u30a4\u3055\u308c\u3066\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u8868\u793a\u3055\u305b\u305f\u308a\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u4e0a\u304b\u3089\u53d6\u5f97\u3057\u305f\u60c5\u5831\u3092\u8868\u793a\u3055\u305b\u305f\u308a\u3001\u7b49\u4f55\u3067\u3082\u3059\u308b\u3053\u3068\u3082\u51fa\u6765\u308b\u3002<\/p>\n<p>\u30c7\u30a3\u30b9\u30c8\u30ed\u306b\u3088\u3063\u3066\u65b9\u6cd5\u306f\u7570\u306a\u308b\u3088\u3046\u3060\u304c\u3001\u4f8b\u3048\u3070 Ubuntu20 \u3067\u306f\u3001 <code>\/etc\/update-motd.d\/<\/code> \u4ee5\u4e0b\u306b\u7f6e\u3044\u3066\u3042\u308b\u30d5\u30a1\u30a4\u30eb\u304c\u30d5\u30a1\u30a4\u30eb\u540d\u9806\u306b\u5b9f\u884c\u3055\u308c\u308b\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u304c <code>10-~<\/code>, <code>50-~<\/code> \u306e\u3088\u3046\u306a\u30d5\u30a1\u30a4\u30eb\u540d\u306a\u306e\u3067\u3001\u5148\u982d\u306e\u6570\u5b57\u3092\u8abf\u6574\u3059\u308c\u3070\u7c21\u5358\u306b\u8868\u793a\u9806\u5e8f\u3092\u5909\u3048\u3089\u308c\u308b\u3002\u5b9f\u884c\u6a29\u9650\u304c\u306a\u3044\u30d5\u30a1\u30a4\u30eb\u306f\u7121\u8996\u3055\u308c\u308b\u306e\u3067\u3001\u4e0d\u8981\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u306f\u524a\u9664\u305b\u305a\u3068\u3082\u5b9f\u884c\u6a29\u9650\u3092\u5916\u3059\u3060\u3051\u3067\u8868\u793a\u3055\u308c\u306a\u304f\u51fa\u6765\u308b\u3002<\/p>\n<h2>\u4f8b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001<code>\/etc\/update-motd.d\/00-header<\/code> \u306a\u3069\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3067\u4e0b\u8a18\u3092\u7f6e\u304f\u3002<\/p>\n<pre><code class=\"language-sh\">#! \/bin\/bash\n\necho &quot;==============================&quot;\necho &quot;Elixir Social checklist server&quot;\necho &quot;==============================\\n&quot;\n\nipv4=$(curl http:\/\/169.254.169.254\/latest\/meta-data\/public-ipv4)\necho &quot;Public IPv4: $ipv4\\n\\n&quot;<\/code><\/pre>\n<p>AWS \u306a\u3089\u3070\u3001 <code>meta-data<\/code> \u3084 <code>aws-cli<\/code> \u3067 <code>ec2 describe-instance<\/code> \u306a\u3069\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u5de5\u592b\u3059\u308c\u3070\u3001\u30b5\u30fc\u30d0\u53f0\u6570\u304c\u5897\u3048\u3066\u304d\u305f\u3068\u304d\u3067\u3082\u78ba\u8a8d\u306e\u624b\u9593\u306a\u3069\u3092\u6e1b\u3089\u3057\u305f\u308a\u51fa\u6765\u308b\u3002<\/p>\n<p>\u6ce8\u610f\u70b9\u306f\u3001ssh \u306e\u305f\u3073\u306b\u5b9f\u884c\u3055\u308c\u308b\u306e\u3067\u3001\u91cd\u3044\u51e6\u7406\u3092\u5165\u308c\u308b\u3068 ssh \u30ed\u30b0\u30a4\u30f3\u304c\u9045\u304f\u306a\u3063\u3066\u30b9\u30c8\u30ec\u30b9\u306b\u306a\u308b\u3068\u3053\u308d\u3060\u308d\u3046\u304b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux \u306e (message of the day) \u3092\u4f7f\u3063\u3066\u3001 ssh \u3057\u305f\u76f4\u5f8c\u306b\u6a19\u6e96\u51fa\u529b\u3059\u308b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u51fa\u6765\u308b\u3002 motd \u3067\u306f\u3001\u4efb\u610f\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u306a\u306e\u3067\u3001\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u66f8\u3044\u305f\u308a  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3959,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[33,7],"class_list":["post-3262","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-development","tag-aws","tag-linux"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/posts\/3262","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/comments?post=3262"}],"version-history":[{"count":3,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/posts\/3262\/revisions"}],"predecessor-version":[{"id":4031,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/posts\/3262\/revisions\/4031"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/media\/3959"}],"wp:attachment":[{"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/media?parent=3262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/categories?post=3262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/tags?post=3262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}