{"id":32855,"date":"2024-11-30T17:37:32","date_gmt":"2024-11-30T08:37:32","guid":{"rendered":"https:\/\/www.mubit.co.jp\/pb-blog\/?p=32855"},"modified":"2025-07-30T14:48:51","modified_gmt":"2025-07-30T05:48:51","slug":"rockylinux-9-3-almalinux-9-3-redhat-9-3%e4%bb%a5%e9%99%8d%e3%81%a7ssh-%e3%83%91%e3%82%b9%e3%83%af%e3%83%bc%e3%83%89%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3","status":"publish","type":"post","link":"https:\/\/www.mubit.co.jp\/pb-blog\/?p=32855","title":{"rendered":"RockyLinux 9.3 \/ AlmaLinux 9.3 \/ RedHat 9.3\u4ee5\u964d\u3067ssh \u30d1\u30b9\u30ef\u30fc\u30c9\u30ed\u30b0\u30a4\u30f3"},"content":{"rendered":"<p>RockyLinux \/ AlmaLinux \/ RedHat 9.3 \u4ee5\u964d\u3067\u306f\u3001root \u30a2\u30ab\u30a6\u30f3\u30c8\u3067ssh \u3067\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u30ed\u30b0\u30a4\u30f3\u3092\u884c\u3046\u5834\u5408\u30019.2\u4ee5\u524d\u3068\u306f\u7570\u306a\u308a\u4e00\u90e8\u4fee\u6b63\u304c\u5fc5\u8981\u3067\u3059<\/p>\n<p><a href=\"https:\/\/www.mubit.co.jp\/pb-blog\/wp-content\/uploads\/2024\/11\/teraterm.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-32865\" src=\"https:\/\/www.mubit.co.jp\/pb-blog\/wp-content\/uploads\/2024\/11\/teraterm.png\" alt=\"\" width=\"192\" height=\"192\" srcset=\"https:\/\/www.mubit.co.jp\/pb-blog\/wp-content\/uploads\/2024\/11\/teraterm.png 192w, https:\/\/www.mubit.co.jp\/pb-blog\/wp-content\/uploads\/2024\/11\/teraterm-150x150.png 150w\" sizes=\"auto, (max-width: 192px) 100vw, 192px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u4fee\u6b63\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u306f\u4ee5\u4e0b\u306e3\u500b<\/p>\n<p><strong>\/etc\/cloud\/cloud.cfg<\/strong><\/p>\n<pre>disable_root: <span style=\"background-color: #ffff99;\">0<\/span>\r\nssh_pwauth: <span style=\"background-color: #ffff99;\">1<\/span><\/pre>\n<p>&nbsp;<\/p>\n<p><strong>\/etc\/ssh\/sshd_config<\/strong><\/p>\n<pre>PermitRootLogin\u3000 <span style=\"background-color: #ffff99;\">yes<\/span>\r\nPasswordAuthentication \u3000<span style=\"background-color: #ffff99;\">yes<\/span><\/pre>\n<p>&nbsp;<\/p>\n<p>sshd_config \u5185\u3067\u4ee5\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3093\u3067\u3044\u308b<\/p>\n<p><span style=\"background-color: #ffff99;\">Include\u3000 \/etc\/ssh\/ssh_config.d\/*.conf<\/span><\/p>\n<p>&nbsp;<\/p>\n<pre>[root@rocky-test]# \u3000cat  \/etc\/ssh\/sshd_config.d\/50-cloud-init.conf\r\n\r\nPasswordAuthentication\u00a0 <span style=\"background-color: #ffff99;\">no\r\n\r\n<\/span><\/pre>\n<p>\u3053\u306e 50-cloud-init.conf \u30d5\u30a1\u30a4\u30eb\u3092\u300c<span style=\"background-color: #ffff99;\">\u524a\u9664<\/span>\u300d\u3000\u3082\u3057\u304f\u306f\u3000PasswordAuthentication\u00a0 <span style=\"background-color: #ffff99;\">yes <\/span>\u306b\u5909\u66f4<\/p>\n<p>&nbsp;<\/p>\n<p><strong>cloud.init\u3092\u5229\u7528\u306e\u5834\u5408<\/strong><\/p>\n<pre>[root@rocky-test]#  cat  \/etc\/cloud\/cloud.int\r\n\r\n#disable_root: true\r\ndisable_root: <span style=\"background-color: #ffff99;\">false<\/span>\r\n\r\n#ssh_pwauth: false\r\nssh_pwauth: <span style=\"background-color: #ffff99;\">true<\/span><\/pre>\n<p>&nbsp;<\/p>\n<p><strong>root\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u8a2d\u5b9a<\/strong><\/p>\n<pre>[root@rocky-test]# passwd\r\nChanging password for user root.\r\nNew password:                     \u2190\u3000\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u5165\u529b\r\nRetype new password:\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u2190\u3000\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u518d\u5165\u529b\r\npasswd: all authentication tokens updated successfully.\r\n[root@rocky-test]#\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>sshd \u306e\u518d\u8d77\u52d5<\/strong><\/p>\n<pre>[root@rocky-test ~]# systemctl  restart  sshd\r\n[root@rocky-test ~]#\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Firewall \u306722\u756a\u30dd\u30fc\u30c8\u3067\u306e\u30a2\u30af\u30bb\u30b9\u3092\u8a31\u53ef<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.mubit.co.jp\/pb-blog\/wp-content\/uploads\/2024\/11\/tera-term-0.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-32867\" src=\"https:\/\/www.mubit.co.jp\/pb-blog\/wp-content\/uploads\/2024\/11\/tera-term-0.png\" alt=\"\" width=\"301\" height=\"198\" srcset=\"https:\/\/www.mubit.co.jp\/pb-blog\/wp-content\/uploads\/2024\/11\/tera-term-0.png 496w, https:\/\/www.mubit.co.jp\/pb-blog\/wp-content\/uploads\/2024\/11\/tera-term-0-300x197.png 300w\" sizes=\"auto, (max-width: 301px) 100vw, 301px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>RockyLinux \/ AlmaLinux \/ RedHat 9.3 \u4ee5\u964d\u3067\u306f\u3001root \u30a2\u30ab\u30a6\u30f3\u30c8\u3067ssh \u3067\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u30ed\u30b0\u30a4\u30f3\u3092\u884c\u3046\u5834\u5408\u30019.2\u4ee5\u524d\u3068\u306f\u7570\u306a\u308a\u4e00\u90e8\u4fee\u6b63\u304c\u5fc5\u8981\u3067\u3059 &nbsp; &nbsp; &#038;nb [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[88],"tags":[],"class_list":["post-32855","post","type-post","status-publish","format-standard","hentry","category-ssh"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.mubit.co.jp\/pb-blog\/index.php?rest_route=\/wp\/v2\/posts\/32855","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mubit.co.jp\/pb-blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mubit.co.jp\/pb-blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mubit.co.jp\/pb-blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mubit.co.jp\/pb-blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=32855"}],"version-history":[{"count":10,"href":"https:\/\/www.mubit.co.jp\/pb-blog\/index.php?rest_route=\/wp\/v2\/posts\/32855\/revisions"}],"predecessor-version":[{"id":32860,"href":"https:\/\/www.mubit.co.jp\/pb-blog\/index.php?rest_route=\/wp\/v2\/posts\/32855\/revisions\/32860"}],"wp:attachment":[{"href":"https:\/\/www.mubit.co.jp\/pb-blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=32855"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mubit.co.jp\/pb-blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=32855"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mubit.co.jp\/pb-blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=32855"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}