{"id":501803,"date":"2026-11-05T16:05:35","date_gmt":"2026-11-05T13:05:35","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=501803"},"modified":"2026-11-05T16:05:35","modified_gmt":"2026-11-05T13:05:35","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=501803","title":{"rendered":"\u0420\u0430\u0441\u043a\u0440\u044b\u0442\u0430 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c sshhole \u0432\u00a0OpenSSH \u043d\u0430\u00a0\u0431\u0430\u0437\u0435 musl Linux\u00a0\u2014 \u0434\u043e\u0441\u0442\u0443\u043f \u043a\u00a0\u0443\u0447\u0451\u0442\u043d\u044b\u043c \u0437\u0430\u043f\u0438\u0441\u044f\u043c, \u043d\u0435\u00a0\u0437\u0430\u0449\u0438\u0449\u0451\u043d\u043d\u044b\u043c \u043f\u0430\u0440\u043e\u043b\u0435\u043c"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/extt\/39\/5e\/16\/395e1684251fb67a1528826e5dd2894e.png\" alt=\"\" title=\"\" width=\"524\" height=\"445\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/extt\/39\/5e\/16\/395e1684251fb67a1528826e5dd2894e.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/extt\/39\/5e\/16\/395e1684251fb67a1528826e5dd2894e.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0420\u0430\u0441\u043a\u0440\u044b\u0442\u0430 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <a href=\"https:\/\/sshhole.com\/\" rel=\"noopener nofollow\">sshhole<\/a> \u0432\u00a0OpenSSH \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 musl Linux (musl-based Linux, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0432 Alpine, OpenWrt, Buildroot, Yocto, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 Docker, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043b\u0438), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441 2016 \u0433\u043e\u0434\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u043b\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a\u00a0\u0443\u0447\u0451\u0442\u043d\u044b\u043c \u0437\u0430\u043f\u0438\u0441\u044f\u043c, \u043d\u0435\u00a0\u0437\u0430\u0449\u0438\u0449\u0451\u043d\u043d\u044b\u043c \u043f\u0430\u0440\u043e\u043b\u0435\u043c. <\/p>\n<p>\u0423\u0447\u0451\u0442\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, root, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 \u0442\u043e\u043b\u044c\u043a\u043e SSH-\u043a\u043b\u044e\u0447\u0438, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0438\u0437 LDAP \u0438\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 \u043e\u0431\u0440\u0430\u0437\u0430\u0445 Alpine \u0434\u043b\u044f AWS \u0438 Azure), \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u043f\u0430\u0440\u043e\u043b\u044c, \u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u0434\u043b\u0438\u043d\u0430 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 256 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.<\/p>\n<p>\u0417\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u044b\u00a0\u043b\u0438 \u0432\u044b \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439? <\/p>\n<ul>\n<li>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u00a0\u043b\u0438 \u0432\u0430\u0448 sshd \u0432\u00a0\u0441\u0440\u0435\u0434\u0435 \u0441\u00a0\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 musl (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u00a0Alpine, OpenWrt, Buildroot \u0438\u043b\u0438\u00a0Yocto)? <\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f\u00a0\u043b\u0438 \u043f\u0440\u0438\u00a0\u044d\u0442\u043e\u043c PAM? (\u0412 Alpine \u043f\u0430\u043a\u0435\u0442 openssh\u2011server \u043f\u043e\u00a0\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u0431\u0435\u0437\u00a0PAM; \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b \u0442\u0430\u043a\u0436\u0435 \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043b\u0438 UsePAM no \u0432\u00a0\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438). <\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u0440\u0435\u0448\u0451\u043d\u00a0\u043b\u0438 \u0432\u0445\u043e\u0434 \u043f\u043e\u00a0\u043f\u0430\u0440\u043e\u043b\u044e? (\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u043d \u0440\u0430\u0437\u0440\u0435\u0448\u0451\u043d). <\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u0442\u044c\u00a0\u043b\u0438 \u0432\u00a0\u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0443\u0447\u0451\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c, \u0443\u00a0\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u00a0\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u043e\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0441\u0438\u043c\u0432\u043e\u043b * (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u044e\u0447\u0438; \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0438\u0437\u00a0LDAP; \u0438\u043b\u0438\u00a0\u0443\u0447\u0435\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c root \u0432\u00a0Alpine)?<\/p>\n<\/li>\n<li>\n<p>\u0418 \u0435\u0441\u0442\u044c\u00a0\u043b\u0438 \u043f\u0440\u0438\u00a0\u044d\u0442\u043e\u043c \u0432\u00a0\u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0434\u0440\u0443\u0433\u0430\u044f \u0443\u0447\u0451\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0441\u00a0\u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u043c \u043f\u0430\u0440\u043e\u043b\u0435\u043c? <\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u0434\u043b\u044f\u00a0\u0443\u0447\u0451\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u00a0\u043f\u0430\u0440\u043e\u043b\u0435\u043c * \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u0440\u0438\u043c\u0435\u0442 \u043b\u044e\u0431\u043e\u0439 \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u0438\u043d\u043e\u0439 \u043e\u0442 257\u00a0\u0434\u043e 1024\u00a0\u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. <\/p>\n<\/li>\n<li>\n<p>\u0412\u00a0\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043e\u0431\u0440\u0430\u0437\u0430\u0445 Alpine \u0434\u043b\u044f\u00a0AWS \u0438 Azure \u0442\u0430\u043a\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0443\u00a0\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u00a0\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e (alpine), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u00a0\u0442\u043e\u043c\u0443\u00a0\u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0430\u0432\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0447\u0435\u0440\u0435\u0437 doas \u0431\u0435\u0437\u00a0\u0432\u0432\u043e\u0434\u0430 \u043f\u0430\u0440\u043e\u043b\u044f\u00a0\u2014 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u044d\u0442\u043e \u0434\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0430 \u0441\u0443\u043f\u0435\u0440\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (root). <\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 Debian, Ubuntu, Fedora \u0438\u043b\u0438\u00a0\u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432 \u0441\u00a0\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 glibc, \u0435\u0441\u043b\u0438 \u0443\u00a0\u0432\u0430\u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d PAM, \u0438\u043b\u0438\u00a0\u0435\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 dropbear \u043b\u0438\u0431\u043e OpenSSH \u0432\u00a0\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 OpenBSD\u00a0\u2014 \u0432\u044b \u0432\u00a0\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0430\u0441 \u0432\u0437\u043b\u043e\u043c\u0430\u043b\u0438? \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435. <\/p>\n<pre><code class=\"bash\">$ grep \"Accepted password\" \/var\/log\/messagesNov  2 03:14:07 your-box sshd[2211]: Accepted password for alpine from 203.0.113.66 port 41822 ssh2$ grep '^alpine:' \/etc\/shadowalpine:*:20125:0:99999:7:::<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper\"><\/span><\/a><\/div><\/pre>\n<p>\u0412 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 openssh 10.6p2 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0430.<\/p>\n<pre><code class=\"bash\"># \u043f\u043e\u043a\u0430 \u043d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f? \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0432\u0445\u043e\u0434 \u043f\u043e \u043f\u0430\u0440\u043e\u043b\u044e.$ echo \"PasswordAuthentication no\" &gt; \/etc\/ssh\/sshd_config.d\/00-no-passwords.conf$ rc-service sshd restart<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/extt\/fe\/0a\/26\/fe0a26fa825c737725615fe5731f62a4.png\" alt=\"\u043e\u0434\u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0430 \u0431\u0430\u0437\u0435 Debian, \u043e\u0434\u043d\u0430 \u2014 \u043d\u0430 \u0431\u0430\u0437\u0435 Alpine. \u0432\u0432\u043e\u0434\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u0432\u0441\u0451 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u044f\u043c\u043e \u0437\u0434\u0435\u0441\u044c, \u0432 \u0432\u0430\u0448\u0435\u043c \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435; \u043d\u0438\u043a\u0430\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0438\u043a\u0443\u0434\u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f\" title=\"\u043e\u0434\u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0430 \u0431\u0430\u0437\u0435 Debian, \u043e\u0434\u043d\u0430 \u2014 \u043d\u0430 \u0431\u0430\u0437\u0435 Alpine. \u0432\u0432\u043e\u0434\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u0432\u0441\u0451 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u044f\u043c\u043e \u0437\u0434\u0435\u0441\u044c, \u0432 \u0432\u0430\u0448\u0435\u043c \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435; \u043d\u0438\u043a\u0430\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0438\u043a\u0443\u0434\u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f\" width=\"960\" height=\"528\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/extt\/fe\/0a\/26\/fe0a26fa825c737725615fe5731f62a4.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/extt\/fe\/0a\/26\/fe0a26fa825c737725615fe5731f62a4.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u043e\u0434\u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0430 \u0431\u0430\u0437\u0435 Debian, \u043e\u0434\u043d\u0430 \u2014 \u043d\u0430 \u0431\u0430\u0437\u0435 Alpine. \u0432\u0432\u043e\u0434\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u0432\u0441\u0451 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u044f\u043c\u043e \u0437\u0434\u0435\u0441\u044c, \u0432 \u0432\u0430\u0448\u0435\u043c \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435; \u043d\u0438\u043a\u0430\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0438\u043a\u0443\u0434\u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/extt\/2a\/c8\/73\/2ac8730b10335071b1e7e0bf7535663e.png\" width=\"934\" height=\"563\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/extt\/2a\/c8\/73\/2ac8730b10335071b1e7e0bf7535663e.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/extt\/2a\/c8\/73\/2ac8730b10335071b1e7e0bf7535663e.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/extt\/c1\/6f\/c7\/c16fc7e3428a0c84d60e61dcf17df752.png\" width=\"888\" height=\"381\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/extt\/c1\/6f\/c7\/c16fc7e3428a0c84d60e61dcf17df752.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/extt\/c1\/6f\/c7\/c16fc7e3428a0c84d60e61dcf17df752.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/extt\/cd\/ec\/20\/cdec20efef6361a63f75382135fd796e.png\" width=\"956\" height=\"534\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/extt\/cd\/ec\/20\/cdec20efef6361a63f75382135fd796e.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/extt\/cd\/ec\/20\/cdec20efef6361a63f75382135fd796e.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/extt\/62\/47\/56\/624756a106fe6bab22a6b19d4aee63d8.png\" width=\"1171\" height=\"865\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/extt\/62\/47\/56\/624756a106fe6bab22a6b19d4aee63d8.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/extt\/62\/47\/56\/624756a106fe6bab22a6b19d4aee63d8.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1104006\/\">https:\/\/habr.com\/ru\/articles\/1104006\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0420\u0430\u0441\u043a\u0440\u044b\u0442\u0430 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c sshhole \u0432\u00a0OpenSSH \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 musl Linux (musl-based Linux, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0432 Alpine, OpenWrt, Buildroot, Yocto, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 Docker, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043b\u0438), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441 2016 \u0433\u043e\u0434\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u043b\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a\u00a0\u0443\u0447\u0451\u0442\u043d\u044b\u043c \u0437\u0430\u043f\u0438\u0441\u044f\u043c, \u043d\u0435\u00a0\u0437\u0430\u0449\u0438\u0449\u0451\u043d\u043d\u044b\u043c \u043f\u0430\u0440\u043e\u043b\u0435\u043c. \u0423\u0447\u0451\u0442\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, root, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 \u0442\u043e\u043b\u044c\u043a\u043e SSH-\u043a\u043b\u044e\u0447\u0438, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0438\u0437 LDAP \u0438\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 \u043e\u0431\u0440\u0430\u0437\u0430\u0445 Alpine \u0434\u043b\u044f AWS \u0438 Azure), \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u043f\u0430\u0440\u043e\u043b\u044c, \u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u0434\u043b\u0438\u043d\u0430 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 256 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.\u0417\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u044b\u00a0\u043b\u0438 \u0432\u044b \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439? \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u00a0\u043b\u0438 \u0432\u0430\u0448 sshd \u0432\u00a0\u0441\u0440\u0435\u0434\u0435 \u0441\u00a0\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 musl (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u00a0Alpine, OpenWrt, Buildroot \u0438\u043b\u0438\u00a0Yocto)? \u041d\u0435\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f\u00a0\u043b\u0438 \u043f\u0440\u0438\u00a0\u044d\u0442\u043e\u043c PAM? (\u0412 Alpine \u043f\u0430\u043a\u0435\u0442 openssh\u2011server \u043f\u043e\u00a0\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u0431\u0435\u0437\u00a0PAM; \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b \u0442\u0430\u043a\u0436\u0435 \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043b\u0438 UsePAM no \u0432\u00a0\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438). \u0420\u0430\u0437\u0440\u0435\u0448\u0451\u043d\u00a0\u043b\u0438 \u0432\u0445\u043e\u0434 \u043f\u043e\u00a0\u043f\u0430\u0440\u043e\u043b\u044e? (\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u043d \u0440\u0430\u0437\u0440\u0435\u0448\u0451\u043d). \u0415\u0441\u0442\u044c\u00a0\u043b\u0438 \u0432\u00a0\u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0443\u0447\u0451\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c, \u0443\u00a0\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u00a0\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u043e\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0441\u0438\u043c\u0432\u043e\u043b * (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u044e\u0447\u0438; \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0438\u0437\u00a0LDAP; \u0438\u043b\u0438\u00a0\u0443\u0447\u0435\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c root \u0432\u00a0Alpine)?\u0418 \u0435\u0441\u0442\u044c\u00a0\u043b\u0438 \u043f\u0440\u0438\u00a0\u044d\u0442\u043e\u043c \u0432\u00a0\u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0434\u0440\u0443\u0433\u0430\u044f \u0443\u0447\u0451\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0441\u00a0\u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u043c \u043f\u0430\u0440\u043e\u043b\u0435\u043c? \u0415\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u0434\u043b\u044f\u00a0\u0443\u0447\u0451\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u00a0\u043f\u0430\u0440\u043e\u043b\u0435\u043c * \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u0440\u0438\u043c\u0435\u0442 \u043b\u044e\u0431\u043e\u0439 \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u0438\u043d\u043e\u0439 \u043e\u0442 257\u00a0\u0434\u043e 1024\u00a0\u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u0412\u00a0\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043e\u0431\u0440\u0430\u0437\u0430\u0445 Alpine \u0434\u043b\u044f\u00a0AWS \u0438 Azure \u0442\u0430\u043a\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0443\u00a0\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u00a0\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e (alpine), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u00a0\u0442\u043e\u043c\u0443\u00a0\u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0430\u0432\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0447\u0435\u0440\u0435\u0437 doas \u0431\u0435\u0437\u00a0\u0432\u0432\u043e\u0434\u0430 \u043f\u0430\u0440\u043e\u043b\u044f\u00a0\u2014 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u044d\u0442\u043e \u0434\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0430 \u0441\u0443\u043f\u0435\u0440\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (root). \u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 Debian, Ubuntu, Fedora \u0438\u043b\u0438\u00a0\u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432 \u0441\u00a0\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 glibc, \u0435\u0441\u043b\u0438 \u0443\u00a0\u0432\u0430\u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d PAM, \u0438\u043b\u0438\u00a0\u0435\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 dropbear \u043b\u0438\u0431\u043e OpenSSH \u0432\u00a0\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 OpenBSD\u00a0\u2014 \u0432\u044b \u0432\u00a0\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438.\u0412\u0430\u0441 \u0432\u0437\u043b\u043e\u043c\u0430\u043b\u0438? \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435. $ grep &#171;Accepted password&#187; \/var\/log\/messagesNov  2 03:14:07 your-box sshd[2211]: Accepted password for alpine from 203.0.113.66 port 41822 ssh2$ grep &#8216;^alpine:&#8217; \/etc\/shadowalpine:*:20125:0:99999:7:::\u0412 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 openssh 10.6p2 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0430.# \u043f\u043e\u043a\u0430 \u043d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f? \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0432\u0445\u043e\u0434 \u043f\u043e \u043f\u0430\u0440\u043e\u043b\u044e.$ echo &#171;PasswordAuthentication no&#187; &gt; \/etc\/ssh\/sshd_config.d\/00-no-passwords.conf$ rc-service sshd restart\u043e\u0434\u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0430 \u0431\u0430\u0437\u0435 Debian, \u043e\u0434\u043d\u0430 \u2014 \u043d\u0430 \u0431\u0430\u0437\u0435 Alpine. \u0432\u0432\u043e\u0434\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u0432\u0441\u0451 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u044f\u043c\u043e \u0437\u0434\u0435\u0441\u044c, \u0432 \u0432\u0430\u0448\u0435\u043c \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435; \u043d\u0438\u043a\u0430\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0438\u043a\u0443\u0434\u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 https:\/\/habr.com\/ru\/articles\/1104006\/<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-501803","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/501803","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=501803"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/501803\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=501803"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=501803"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=501803"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}