{"id":1270,"date":"2022-07-02T15:36:00","date_gmt":"2022-07-02T06:36:00","guid":{"rendered":"https:\/\/blog.kifuyu.net\/?p=1270"},"modified":"2022-10-01T11:23:18","modified_gmt":"2022-10-01T02:23:18","slug":"%e9%9b%91%e8%a8%982022-7-2","status":"publish","type":"post","link":"https:\/\/blog.kifuyu.net\/?p=1270","title":{"rendered":"\u96d1\u8a18(2022\/7\/2)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u3000Linux\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u52e2\u306e\u4e00\u4eba\u3067\u3059\u3002\u305f\u3060\u30b5\u30fc\u30d0\u30fc\u306eOS\u306f\u3069\u308c\u304c\u826f\u3055\u305d\u3046\u3063\u3066\u306e\u306f\u306a\u3093\u3068\u306a\u304f\u77e5\u3063\u3066\u3044\u3066\u3001\u5927\u5b66\u306e\u77e5\u308a\u5408\u3044\u304b\u3089\u5439\u304d\u8fbc\u307e\u308c\u305fCentOS\u3092\u597d\u3093\u3067\u4f7f\u3063\u3066\u3044\u307e\u3057\u305f\u3002<br>\u305f\u3060\u6628\u5e74\u306e\u4eca\u9803\u304f\u3089\u3044\u306bCentOS\u306e\u3042\u308a\u65b9\u304c\u5909\u308f\u308b\u3053\u3068\u3092\u8033\u306b\u3057\u3001\u6163\u308c\u304d\u3089\u306a\u3044\u3046\u3061\u306bOS\u306e\u5909\u66f4\u3092\u8003\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<br>\u671f\u9650\u5207\u308c\u306f2024\u5e746\u6708\u3067\u3042\u308b\u3082\u306e\u306e\u3001kifuyu.net\u306e\u904b\u7528\u74b0\u5883\u304c\u82e5\u5e72\u53e4\u304f\u306a\u3063\u3066\u304d\u305f\u3053\u3068\u3082\u3042\u308a\u30b5\u30fc\u30d0\u30fc\u518d\u69cb\u6210\u3068OS\u5909\u66f4\u3092\u540c\u6642\u306b\u5b9f\u65bd\u3067\u3059\u3002<br>\u3000\u3044\u3063\u305d\u306e\u4e8b\u3001\u500b\u4eba\u30fb\u958b\u767a\u7528\u9014\u3067\u3042\u308c\u3070\u7121\u511f\u3067\u4f7f\u3048\u308bRHEL\u306b\u3057\u3066\u307f\u308b\u306e\u3082\u3042\u308a\u3060\u3063\u305f\u3051\u3069\u3001\u7279\u306b\u601d\u3044\u5165\u308c\u3082\u306a\u3044\u306e\u3067Debian\u7cfb\u306eUbuntu\u3092\u9078\u629e\u3002<br><br>\u3053\u306e\u65e5\u306e\u65b0\u9bd6\u306b\u304a\u3051\u308b\u4f5c\u696d\u306f\u4e0b\u8a18\u306e\u901a\u308a\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u30e6\u30fc\u30b6\u306e\u8ffd\u52a0<\/li><li>SSH\u306e\u8a2d\u5b9a<\/li><li>Fail2ban\u306e\u8a2d\u5b9a<\/li><li>DB\u306ekill<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\uff1eSSH\u306e\u8a2d\u5b9a<br>&#8220;SSH2 User Auth Failure \u201cpublickey,gssapi-keyex,gssapi-with-mic\u201d<br>Status=1004 Send Disconnect Message\u2026<br>publickey(ssh-ed25519),publickey(ssh-ed25519)&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"> \u4e0a\u8a18\u306e\u30dd\u30c3\u30d7\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u51fa\u3066\u304d\u3066\u3057\u307e\u3063\u3066\u898b\u4e8b\u306b\u30cf\u30de\u3063\u305f\u3002<br>\u516c\u958b\u9375\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3092\u898b\u76f4\u3057\u305f\u3089\u3001\u3088\u3046\u3084\u304fssh\u3067\u306e\u901a\u4fe1\u304c\u901a\u3063\u305f\u3002<br>\u697d\u3057\u3088\u3046\u3068Rlogin\u3067\u751f\u6210\u3057\u305f\u3051\u3069\u3001\u7d50\u5c40ssh-keygen\u3067\u751f\u6210\u3057\u305f\u65b9\u304c\u30b9\u30e0\u30fc\u30ba\u306b\u884c\u3051\u305f\u3068\u3044\u3046\u3002\u539f\u56e0\u306fopenssh\u306e\u8a2d\u5b9a\u306b\u3042\u308b\u306e\u304b\u3001Rlogin\u306e\u305b\u3044\u306a\u306e\u304b\u3088\u304f\u308f\u304b\u3089\u3093\u3002\u5f8c\u8005\u307d\u3044\u3051\u3069\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/\/Rlogin\u3067\u751f\u6210\n-----BEGIN OPENSSH PRIVATE KEY-----\n*****\n-----END OPENSSH PRIVATE KEY-----\n-&gt;\n\/\/ssh-keygen\u3067\u751f\u6210\u3057\u305f\u3084\u3064\u3002\nssh-ed25519 ***** hogehoge\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u3000sshd\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306f\u3001\/etc\/ssh\/\u914d\u4e0b\u306esshd_config\u3092sshd_config.d\u3078\u30b3\u30d4\u30fc\u3057\u3066\u3001hogehoge.conf\u3078\u30ea\u30cd\u30fc\u30e0\u3002<br>\u307e\u305f\u540c\u30d5\u30a1\u30a4\u30eb\u3092\u4e0b\u8a18\u306e\u8a2d\u5b9a\u306b\u66f8\u304d\u63db\u3048\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/\/ \u30b3\u30d4\u30fc\u5148\u306e*.conf\u5185\u306einclude\u3092\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\n- Include \/etc\/ssh\/sshd_config.d\/*.conf\n+ # Include \/etc\/ssh\/sshd_config.d\/*.conf\n\n\/\/ \u30dd\u30fc\u30c8\u756a\u53f7\u5909\u66f4\u3002Firewall\u306e\u8a2d\u5b9a\u3082\u5fd8\u308c\u305a\u306b\u3002\n- Port 22\n+ Port hogehoge\n\n\/\/ root\u30e6\u30fc\u30b6\u3067\u30ed\u30b0\u30a4\u30f3\u306f\u3057\u306a\u3044\u306e\u3067\u7121\u52b9\u5316\n- PermitRootLogin yes\n+ PermitRootLogin no\n\n\/\/ \u516c\u958b\u9375\u8a8d\u8a3c\u306b\u9650\u5b9a\u306e\u305f\u3081\u5909\u66f4\u3002\u516c\u958b\u9375\u4f7f\u3063\u3066\u308b\u306e\u306b\u3042\u3048\u3066&quot;yes&quot;\u3092\u6307\u5357\u3059\u308b\u8a18\u4e8b\u304c\u3042\u3063\u305f\u3051\u3069\u4f55\u6545\u2026\n- PasswordAuthentication yes\n+ PasswordAuthentication no\n\n\/\/ \u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3057\u306a\u3044\u3068\u4f55\u6545\u304b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u3002&quot;Failed to start OpenBSD Secure Shell server.&quot;\n- Subsystem sftp \/usr\/lib\/openssh\/sftp-server\n+ #Subsystem sftp \/usr\/lib\/openssh\/sftp-server\n\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u3000authorized_keys\u306fssh\u63a5\u7d9a\u3059\u308b\u30e6\u30fc\u30b6\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b(home\/hogehoge\/.ssh\/)\u306b\u7f6e\u3044\u3068\u304f\u5fc5\u8981\u304c\u3042\u308b\u3002<br>\u3057\u3070\u3089\u304froot\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u914d\u7f6e\u3057\u3066\u3044\u305f\u305b\u3044\u3067\u63a5\u7d9a\u3067\u304d\u3093\u304b\u3063\u305f\u3002\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3000Linux\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u52e2\u306e\u4e00\u4eba\u3067\u3059\u3002\u305f\u3060\u30b5\u30fc\u30d0\u30fc\u306eOS\u306f\u3069\u308c\u304c\u826f\u3055\u305d\u3046\u3063\u3066\u306e\u306f\u306a\u3093\u3068\u306a\u304f\u77e5\u3063\u3066\u3044\u3066\u3001\u5927\u5b66\u306e\u77e5\u308a\u5408\u3044\u304b\u3089\u5439\u304d\u8fbc\u307e\u308c\u305fCentOS\u3092\u597d\u3093\u3067\u4f7f\u3063\u3066\u3044\u307e\u3057\u305f\u3002\u305f\u3060\u6628\u5e74\u306e\u4eca\u9803\u304f\u3089\u3044\u306bCentOS\u306e\u3042\u308a\u65b9\u304c\u5909\u308f\u308b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"ja","_original_post":"https:\/\/blog.kifuyu.net\/?p=1270","footnotes":""},"categories":[16,33,15],"tags":[],"class_list":["post-1270","post","type-post","status-publish","format-standard","hentry","category-pc","category-33","category-15","ja"],"_links":{"self":[{"href":"https:\/\/blog.kifuyu.net\/index.php?rest_route=\/wp\/v2\/posts\/1270","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.kifuyu.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.kifuyu.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.kifuyu.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.kifuyu.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1270"}],"version-history":[{"count":0,"href":"https:\/\/blog.kifuyu.net\/index.php?rest_route=\/wp\/v2\/posts\/1270\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.kifuyu.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1270"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.kifuyu.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1270"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.kifuyu.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}