{
  "@context": "https://schema.org",
  "@id": "https://aggr.aymericbeaumet.com/items/hnrss-org/2026-11-05-alpine-linux-security-advisory-openssh-server-password/#webpage",
  "@type": [
    "WebPage",
    "ArchiveComponent"
  ],
  "articleBody": "**If you run `sshd` on Alpine Linux, update `openssh` now and restart `sshd`.** Upgrading the package alone does not replace the running daemon.\n\nIf you cannot update yet, at least disable password logins: set `PasswordAuthentication no` in your sshd configuration and restart `sshd`. Either one closes the hole.\n\n## What is the problem?\n\nAn attacker who can reach your SSH port can log in without knowing any password. It takes one connection, works every time, and needs no retries.\n\nThe attacker needs the name of an account whose password field is `*` (an account with no password set, which is normal for key-only accounts), and needs the machine to have at least one other account with a `$5$` or `$6$` password hash. The attacker then sends a very long password (257 to 1024 bytes). One user with a password is enough: it makes every account without one reachable.\n\nDetails are in the [OpenSSH 10.6p2 release notes](https://www.openssh.com/releasenotes.html). No CVE identifier had been assigned at the time of writing.\n\n## Who is affected?\n\nYou are affected if all of the following are true:\n\n- You run the Alpine `openssh-server` package, which is built without PAM, or you run `openssh-server-pam` with `UsePAM no`. (`openssh-server-pam` with `UsePAM yes` is not affected.)\n- `PasswordAuthentication` is `yes` (the OpenSSH default, unless you changed it).\n- The machine has an account whose password field is `*`. This includes:\n  - `root`, which ships as `root:*` in the base image since about Alpine 3.16. OpenSSH’s default `PermitRootLogin prohibit-password` protects root, so root is only reachable if `PermitRootLogin yes` is set. That does not help if another account that can log in is able to become root, for example through `doas`.\n  - Any key-only user created with `adduser` without a password, or with `usermod -p '*'`.\n  - Users coming from a directory service through musl-nscd (nslcd, winbind, sssd), since they have no shadow entry.\n  - The `alpine` user in the official **tiny-cloud** images (see below).\n- At least one local account has a `$5$` or `$6$` password hash.\n\nAffected releases: every Alpine release we checked, 3.21 through 3.24 and edge, and the older releases that no longer receive regular updates (3.16 to 3.20).\n\n### Who is not affected?\n\n- **Docker and other container users** that do not run `sshd` in the container.\n- Systems with `PasswordAuthentication no`.\n- Systems using `openssh-server-pam` with `UsePAM yes` (with `UsePAM no` you are affected).\n- Locked accounts: those with `!` as the password field in `/etc/shadow` (a line starting `user:!:`). They cannot log in with a password or a key.\n- Systems where no account has a `$`-style password hash.\n- Cloud images configured through cloud-init, which writes `PasswordAuthentication no`.\n\n## How can I fix it?\n\n### 1\\. Update\n\n```\napk upgrade -U -a\n```\n\nAlpine 3.21.10, 3.22.8, 3.23.8 and 3.24.4 contain the fixed package (see the [release announcement](https://alpinelinux.org/posts/alpine-3.21.10-3.22.8-3.23.8-3.24.4-released/)). The fixed package versions are:\n\n| Branch | Fixed `openssh` version |\n| ------ | ----------------------- |\n| edge   | 10.6\\_p2-r0             |\n| 3.24   | 10.3\\_p1-r2             |\n| 3.23   | 10.2\\_p1-r1             |\n| 3.22   | 10.0\\_p1-r11            |\n| 3.21   | 9.9\\_p2-r1              |\n| 3.20   | 9.7\\_p1-r6              |\n| 3.19   | 9.6\\_p1-r3              |\n| 3.18   | 9.3\\_p2-r4              |\n| 3.17   | 9.1\\_p1-r7              |\n| 3.16   | 9.0\\_p1-r6              |\n\n**Restart `sshd` after upgrading** (`rc-service sshd restart`). Upgrading the package does not restart a running `sshd`, so you must do it after.\n\n### 2\\. If you cannot update: disable password authentication\n\nBefore you start, make sure your SSH key login works, and keep your current session open until you have tested a new login.\n\nRun these as root. The first two commands create a drop-in file. Alpine’s default `sshd_config` reads that directory from 3.19 onward; older releases ignore it. The `sed` command changes `yes` to `no` on every `PasswordAuthentication` line in `/etc/ssh/sshd_config`, whatever the spacing, including lines inside a `Match` block. It also adds `PasswordAuthentication no` at the top of the file, for the case where there was no such line, and saves the original as `/etc/ssh/sshd_config.bak`. The last two commands check the configuration, restart the daemon, and show the result:\n\n```\nmkdir -p /etc/ssh/sshd_config.d\necho 'PasswordAuthentication no' > /etc/ssh/sshd_config.d/00-no-passwords.conf\nsed -i.bak -e '1i PasswordAuthentication no' \\\n  -e 's/^\\(\\s*PasswordAuthentication[^y#]*\\)yes/\\1no/i' \\\n  /etc/ssh/sshd_config\nsshd -t && rc-service sshd restart\nsshd -T | grep -i passwordauthentication\n```\n\nThe last command should print `passwordauthentication no`. To undo, delete `/etc/ssh/sshd_config.d/00-no-passwords.conf` and copy `/etc/ssh/sshd_config.bak` back over `/etc/ssh/sshd_config`.\n\n## Cloud images (tiny-cloud)\n\nThe official tiny-cloud images (the qcow2, VHD and AMI artifacts) from **3.18.11 through 3.24.3** ship an `alpine` user with a `*` password field and passwordless `doas`. They are safe on first boot. They become exploitable as soon as any `$6$` hash exists on the machine, for example when an admin sets a console password, or user-data adds a user with `hashed_passwd`. An attacker then gets a shell as `alpine` and can use `doas` to become root.\n\nImages built from 3.21.10, 3.22.8, 3.23.8, 3.24.4 and later include the fixed package. Images from earlier point releases do not, so on every running instance, update `openssh` or disable password authentication.\n\n## Releases that are no longer supported (3.21 and older)\n\nThese releases have the same bug. 3.21 reached its end of support on 2026-11-01, but we have published fixed packages for each release all the way back to 3.16.\n\n## How do I know if I was attacked?\n\nLook in `/var/log/messages` for `sshd` lines reading `Accepted password for` an account that has no password (`alpine`, `root`, or any key-only user). Review `doas` use and recently created users, files and authorized keys on exposed machines. If you cannot rule out a login, treat the machine as compromised.\n\n## How could this happen?\n\nWhen sshd is built without PAM, it checks a password by hashing the attempt with `crypt()` (the C library function that turns a password into its stored hash) and comparing the result to the stored password field. For an account whose stored field is too short to contain a salt (the random prefix of a hash), sshd borrows the salt of another account.\n\nmusl’s `crypt()` returns the string `*` as an error indicator when the key is over 256 bytes long. `*` is also exactly what the stored field contains for every account with no password, so the “hash” matches and the login succeeds.\n\nOpenSSH 10.6p2 avoids the problem in sshd. The stable-branch packages above carry a patch for the same problem.\n\n## Credits\n\nReported by Özgün Kültekin of [Wakefield](https://wakefield.co). Thanks to Damien Miller and Darren Tucker of the OpenSSH project for the fix and the 10.6p2 release, to Timo Teräs for help analyzing the issue, and to Natanael Copa, who built and uploaded the updated packages.\n",
  "authors": [
    "pantalaimon"
  ],
  "captured_at": "2026-11-05T17:57:26.867095589+00:00",
  "category": "news",
  "content_html": "<p><strong>If you run <code>sshd</code> on Alpine Linux, update <code>openssh</code> now and restart <code>sshd</code>.</strong> Upgrading the package alone does not replace the running daemon.</p>\n<p>If you cannot update yet, at least disable password logins: set <code>PasswordAuthentication no</code> in your sshd configuration and restart <code>sshd</code>. Either one closes the hole.</p>\n<h2>What is the problem?</h2>\n<p>An attacker who can reach your SSH port can log in without knowing any password. It takes one connection, works every time, and needs no retries.</p>\n<p>The attacker needs the name of an account whose password field is <code>*</code> (an account with no password set, which is normal for key-only accounts), and needs the machine to have at least one other account with a <code>$5$</code> or <code>$6$</code> password hash. The attacker then sends a very long password (257 to 1024 bytes). One user with a password is enough: it makes every account without one reachable.</p>\n<p>Details are in the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://www.openssh.com/releasenotes.html\">OpenSSH 10.6p2 release notes</a>. No CVE identifier had been assigned at the time of writing.</p>\n<h2>Who is affected?</h2>\n<p>You are affected if all of the following are true:</p>\n<ul>\n<li>You run the Alpine <code>openssh-server</code> package, which is built without PAM, or you run <code>openssh-server-pam</code> with <code>UsePAM no</code>. (<code>openssh-server-pam</code> with <code>UsePAM yes</code> is not affected.)</li>\n<li><code>PasswordAuthentication</code> is <code>yes</code> (the OpenSSH default, unless you changed it).</li>\n<li>The machine has an account whose password field is <code>*</code>. This includes:\n<ul>\n<li><code>root</code>, which ships as <code>root:*</code> in the base image since about Alpine 3.16. OpenSSH’s default <code>PermitRootLogin prohibit-password</code> protects root, so root is only reachable if <code>PermitRootLogin yes</code> is set. That does not help if another account that can log in is able to become root, for example through <code>doas</code>.</li>\n<li>Any key-only user created with <code>adduser</code> without a password, or with <code>usermod -p '*'</code>.</li>\n<li>Users coming from a directory service through musl-nscd (nslcd, winbind, sssd), since they have no shadow entry.</li>\n<li>The <code>alpine</code> user in the official <strong>tiny-cloud</strong> images (see below).</li>\n</ul>\n</li>\n<li>At least one local account has a <code>$5$</code> or <code>$6$</code> password hash.</li>\n</ul>\n<p>Affected releases: every Alpine release we checked, 3.21 through 3.24 and edge, and the older releases that no longer receive regular updates (3.16 to 3.20).</p>\n<h3>Who is not affected?</h3>\n<ul>\n<li><strong>Docker and other container users</strong> that do not run <code>sshd</code> in the container.</li>\n<li>Systems with <code>PasswordAuthentication no</code>.</li>\n<li>Systems using <code>openssh-server-pam</code> with <code>UsePAM yes</code> (with <code>UsePAM no</code> you are affected).</li>\n<li>Locked accounts: those with <code>!</code> as the password field in <code>/etc/shadow</code> (a line starting <code>user:!:</code>). They cannot log in with a password or a key.</li>\n<li>Systems where no account has a <code>$</code>-style password hash.</li>\n<li>Cloud images configured through cloud-init, which writes <code>PasswordAuthentication no</code>.</li>\n</ul>\n<h2>How can I fix it?</h2>\n<h3>1. Update</h3>\n<pre><code><span class=\"code-snippet\">apk upgrade -U -a\n</span></code></pre>\n<p>Alpine 3.21.10, 3.22.8, 3.23.8 and 3.24.4 contain the fixed package (see the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://alpinelinux.org/posts/alpine-3.21.10-3.22.8-3.23.8-3.24.4-released/\">release announcement</a>). The fixed package versions are:</p>\n<table>\n<thead>\n<tr>\n<th>Branch</th>\n<th>Fixed <code>openssh</code> version</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>edge</td>\n<td>10.6_p2-r0</td>\n</tr>\n<tr>\n<td>3.24</td>\n<td>10.3_p1-r2</td>\n</tr>\n<tr>\n<td>3.23</td>\n<td>10.2_p1-r1</td>\n</tr>\n<tr>\n<td>3.22</td>\n<td>10.0_p1-r11</td>\n</tr>\n<tr>\n<td>3.21</td>\n<td>9.9_p2-r1</td>\n</tr>\n<tr>\n<td>3.20</td>\n<td>9.7_p1-r6</td>\n</tr>\n<tr>\n<td>3.19</td>\n<td>9.6_p1-r3</td>\n</tr>\n<tr>\n<td>3.18</td>\n<td>9.3_p2-r4</td>\n</tr>\n<tr>\n<td>3.17</td>\n<td>9.1_p1-r7</td>\n</tr>\n<tr>\n<td>3.16</td>\n<td>9.0_p1-r6</td>\n</tr>\n</tbody>\n</table>\n<p><strong>Restart <code>sshd</code> after upgrading</strong> (<code>rc-service sshd restart</code>). Upgrading the package does not restart a running <code>sshd</code>, so you must do it after.</p>\n<h3>2. If you cannot update: disable password authentication</h3>\n<p>Before you start, make sure your SSH key login works, and keep your current session open until you have tested a new login.</p>\n<p>Run these as root. The first two commands create a drop-in file. Alpine’s default <code>sshd_config</code> reads that directory from 3.19 onward; older releases ignore it. The <code>sed</code> command changes <code>yes</code> to <code>no</code> on every <code>PasswordAuthentication</code> line in <code>/etc/ssh/sshd_config</code>, whatever the spacing, including lines inside a <code>Match</code> block. It also adds <code>PasswordAuthentication no</code> at the top of the file, for the case where there was no such line, and saves the original as <code>/etc/ssh/sshd_config.bak</code>. The last two commands check the configuration, restart the daemon, and show the result:</p>\n<pre><code><span class=\"code-snippet\" data-language=\"Shell\"><span class=\"syntax-source syntax-shell syntax-bash\"><span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">mkdir</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"><span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\"> -</span>p</span> /etc/ssh/sshd_config.d</span>\n<span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-support syntax-function syntax-echo syntax-shell\">echo</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> <span class=\"syntax-string syntax-quoted syntax-single syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-shell\">&#39;</span>PasswordAuthentication no<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-shell\">&#39;</span></span> <span class=\"syntax-keyword syntax-operator syntax-assignment syntax-redirection syntax-shell\">&gt;</span> /etc/ssh/sshd_config.d/00-no-passwords.conf</span>\n<span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">sed</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"><span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\"> -</span>i</span>.bak<span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\"> -</span>e</span> <span class=\"syntax-string syntax-quoted syntax-single syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-shell\">&#39;</span>1i PasswordAuthentication no<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-shell\">&#39;</span></span> <span class=\"syntax-punctuation syntax-separator syntax-continuation syntax-line syntax-shell\">\\\n</span><span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\">  -</span>e</span> <span class=\"syntax-string syntax-quoted syntax-single syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-shell\">&#39;</span>s/^\\(\\s*PasswordAuthentication[^y#]*\\)yes/\\1no/i<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-shell\">&#39;</span></span> <span class=\"syntax-punctuation syntax-separator syntax-continuation syntax-line syntax-shell\">\\\n</span>  /etc/ssh/sshd_config</span>\n<span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">sshd</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"><span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\"> -</span>t</span></span> <span class=\"syntax-keyword syntax-operator syntax-logical syntax-and syntax-shell\">&amp;&amp;</span> <span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">rc-service</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> sshd restart</span>\n<span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">sshd</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"><span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\"> -</span>T</span></span> <span class=\"syntax-keyword syntax-operator syntax-logical syntax-pipe syntax-shell\">|</span> <span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">grep</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"><span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\"> -</span>i</span> passwordauthentication</span>\n</span></span></code></pre>\n<p>The last command should print <code>passwordauthentication no</code>. To undo, delete <code>/etc/ssh/sshd_config.d/00-no-passwords.conf</code> and copy <code>/etc/ssh/sshd_config.bak</code> back over <code>/etc/ssh/sshd_config</code>.</p>\n<h2>Cloud images (tiny-cloud)</h2>\n<p>The official tiny-cloud images (the qcow2, VHD and AMI artifacts) from <strong>3.18.11 through 3.24.3</strong> ship an <code>alpine</code> user with a <code>*</code> password field and passwordless <code>doas</code>. They are safe on first boot. They become exploitable as soon as any <code>$6$</code> hash exists on the machine, for example when an admin sets a console password, or user-data adds a user with <code>hashed_passwd</code>. An attacker then gets a shell as <code>alpine</code> and can use <code>doas</code> to become root.</p>\n<p>Images built from 3.21.10, 3.22.8, 3.23.8, 3.24.4 and later include the fixed package. Images from earlier point releases do not, so on every running instance, update <code>openssh</code> or disable password authentication.</p>\n<h2>Releases that are no longer supported (3.21 and older)</h2>\n<p>These releases have the same bug. 3.21 reached its end of support on 2026-11-01, but we have published fixed packages for each release all the way back to 3.16.</p>\n<h2>How do I know if I was attacked?</h2>\n<p>Look in <code>/var/log/messages</code> for <code>sshd</code> lines reading <code>Accepted password for</code> an account that has no password (<code>alpine</code>, <code>root</code>, or any key-only user). Review <code>doas</code> use and recently created users, files and authorized keys on exposed machines. If you cannot rule out a login, treat the machine as compromised.</p>\n<h2>How could this happen?</h2>\n<p>When sshd is built without PAM, it checks a password by hashing the attempt with <code>crypt()</code> (the C library function that turns a password into its stored hash) and comparing the result to the stored password field. For an account whose stored field is too short to contain a salt (the random prefix of a hash), sshd borrows the salt of another account.</p>\n<p>musl’s <code>crypt()</code> returns the string <code>*</code> as an error indicator when the key is over 256 bytes long. <code>*</code> is also exactly what the stored field contains for every account with no password, so the “hash” matches and the login succeeds.</p>\n<p>OpenSSH 10.6p2 avoids the problem in sshd. The stable-branch packages above carry a patch for the same problem.</p>\n<h2>Credits</h2>\n<p>Reported by Özgün Kültekin of <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://wakefield.co\">Wakefield</a>. Thanks to Damien Miller and Darren Tucker of the OpenSSH project for the fix and the 10.6p2 release, to Timo Teräs for help analyzing the issue, and to Natanael Copa, who built and uploaded the updated packages.</p>\n",
  "content_markdown": "**If you run `sshd` on Alpine Linux, update `openssh` now and restart `sshd`.** Upgrading the package alone does not replace the running daemon.\n\nIf you cannot update yet, at least disable password logins: set `PasswordAuthentication no` in your sshd configuration and restart `sshd`. Either one closes the hole.\n\n## What is the problem?\n\nAn attacker who can reach your SSH port can log in without knowing any password. It takes one connection, works every time, and needs no retries.\n\nThe attacker needs the name of an account whose password field is `*` (an account with no password set, which is normal for key-only accounts), and needs the machine to have at least one other account with a `$5$` or `$6$` password hash. The attacker then sends a very long password (257 to 1024 bytes). One user with a password is enough: it makes every account without one reachable.\n\nDetails are in the [OpenSSH 10.6p2 release notes](https://www.openssh.com/releasenotes.html). No CVE identifier had been assigned at the time of writing.\n\n## Who is affected?\n\nYou are affected if all of the following are true:\n\n- You run the Alpine `openssh-server` package, which is built without PAM, or you run `openssh-server-pam` with `UsePAM no`. (`openssh-server-pam` with `UsePAM yes` is not affected.)\n- `PasswordAuthentication` is `yes` (the OpenSSH default, unless you changed it).\n- The machine has an account whose password field is `*`. This includes:\n  - `root`, which ships as `root:*` in the base image since about Alpine 3.16. OpenSSH’s default `PermitRootLogin prohibit-password` protects root, so root is only reachable if `PermitRootLogin yes` is set. That does not help if another account that can log in is able to become root, for example through `doas`.\n  - Any key-only user created with `adduser` without a password, or with `usermod -p '*'`.\n  - Users coming from a directory service through musl-nscd (nslcd, winbind, sssd), since they have no shadow entry.\n  - The `alpine` user in the official **tiny-cloud** images (see below).\n- At least one local account has a `$5$` or `$6$` password hash.\n\nAffected releases: every Alpine release we checked, 3.21 through 3.24 and edge, and the older releases that no longer receive regular updates (3.16 to 3.20).\n\n### Who is not affected?\n\n- **Docker and other container users** that do not run `sshd` in the container.\n- Systems with `PasswordAuthentication no`.\n- Systems using `openssh-server-pam` with `UsePAM yes` (with `UsePAM no` you are affected).\n- Locked accounts: those with `!` as the password field in `/etc/shadow` (a line starting `user:!:`). They cannot log in with a password or a key.\n- Systems where no account has a `$`-style password hash.\n- Cloud images configured through cloud-init, which writes `PasswordAuthentication no`.\n\n## How can I fix it?\n\n### 1\\. Update\n\n```\napk upgrade -U -a\n```\n\nAlpine 3.21.10, 3.22.8, 3.23.8 and 3.24.4 contain the fixed package (see the [release announcement](https://alpinelinux.org/posts/alpine-3.21.10-3.22.8-3.23.8-3.24.4-released/)). The fixed package versions are:\n\n| Branch | Fixed `openssh` version |\n| ------ | ----------------------- |\n| edge   | 10.6\\_p2-r0             |\n| 3.24   | 10.3\\_p1-r2             |\n| 3.23   | 10.2\\_p1-r1             |\n| 3.22   | 10.0\\_p1-r11            |\n| 3.21   | 9.9\\_p2-r1              |\n| 3.20   | 9.7\\_p1-r6              |\n| 3.19   | 9.6\\_p1-r3              |\n| 3.18   | 9.3\\_p2-r4              |\n| 3.17   | 9.1\\_p1-r7              |\n| 3.16   | 9.0\\_p1-r6              |\n\n**Restart `sshd` after upgrading** (`rc-service sshd restart`). Upgrading the package does not restart a running `sshd`, so you must do it after.\n\n### 2\\. If you cannot update: disable password authentication\n\nBefore you start, make sure your SSH key login works, and keep your current session open until you have tested a new login.\n\nRun these as root. The first two commands create a drop-in file. Alpine’s default `sshd_config` reads that directory from 3.19 onward; older releases ignore it. The `sed` command changes `yes` to `no` on every `PasswordAuthentication` line in `/etc/ssh/sshd_config`, whatever the spacing, including lines inside a `Match` block. It also adds `PasswordAuthentication no` at the top of the file, for the case where there was no such line, and saves the original as `/etc/ssh/sshd_config.bak`. The last two commands check the configuration, restart the daemon, and show the result:\n\n```\nmkdir -p /etc/ssh/sshd_config.d\necho 'PasswordAuthentication no' > /etc/ssh/sshd_config.d/00-no-passwords.conf\nsed -i.bak -e '1i PasswordAuthentication no' \\\n  -e 's/^\\(\\s*PasswordAuthentication[^y#]*\\)yes/\\1no/i' \\\n  /etc/ssh/sshd_config\nsshd -t && rc-service sshd restart\nsshd -T | grep -i passwordauthentication\n```\n\nThe last command should print `passwordauthentication no`. To undo, delete `/etc/ssh/sshd_config.d/00-no-passwords.conf` and copy `/etc/ssh/sshd_config.bak` back over `/etc/ssh/sshd_config`.\n\n## Cloud images (tiny-cloud)\n\nThe official tiny-cloud images (the qcow2, VHD and AMI artifacts) from **3.18.11 through 3.24.3** ship an `alpine` user with a `*` password field and passwordless `doas`. They are safe on first boot. They become exploitable as soon as any `$6$` hash exists on the machine, for example when an admin sets a console password, or user-data adds a user with `hashed_passwd`. An attacker then gets a shell as `alpine` and can use `doas` to become root.\n\nImages built from 3.21.10, 3.22.8, 3.23.8, 3.24.4 and later include the fixed package. Images from earlier point releases do not, so on every running instance, update `openssh` or disable password authentication.\n\n## Releases that are no longer supported (3.21 and older)\n\nThese releases have the same bug. 3.21 reached its end of support on 2026-11-01, but we have published fixed packages for each release all the way back to 3.16.\n\n## How do I know if I was attacked?\n\nLook in `/var/log/messages` for `sshd` lines reading `Accepted password for` an account that has no password (`alpine`, `root`, or any key-only user). Review `doas` use and recently created users, files and authorized keys on exposed machines. If you cannot rule out a login, treat the machine as compromised.\n\n## How could this happen?\n\nWhen sshd is built without PAM, it checks a password by hashing the attempt with `crypt()` (the C library function that turns a password into its stored hash) and comparing the result to the stored password field. For an account whose stored field is too short to contain a salt (the random prefix of a hash), sshd borrows the salt of another account.\n\nmusl’s `crypt()` returns the string `*` as an error indicator when the key is over 256 bytes long. `*` is also exactly what the stored field contains for every account with no password, so the “hash” matches and the login succeeds.\n\nOpenSSH 10.6p2 avoids the problem in sshd. The stable-branch packages above carry a patch for the same problem.\n\n## Credits\n\nReported by Özgün Kültekin of [Wakefield](https://wakefield.co). Thanks to Damien Miller and Darren Tucker of the OpenSSH project for the fix and the 10.6p2 release, to Timo Teräs for help analyzing the issue, and to Natanael Copa, who built and uploaded the updated packages.\n",
  "dateCreated": "2026-11-05T17:57:26.867095589+00:00",
  "date_created": "2026-11-05T14:44:20+00:00",
  "date_modified": "2026-11-05T14:44:20+00:00",
  "date_published": "2026-11-05T14:44:20+00:00",
  "description": "If you run sshd on Alpine Linux, update openssh now and restart sshd. Upgrading the package alone does not replace the running daemon. If you cannot update yet, at least disable password logins: set PasswordAuthentication no in your sshd…",
  "external_url": "https://alpinelinux.org/posts/2026-11-05-openssh-password-authentication-bypass/",
  "git": {
    "commit": "20068632b65d2830a2d54f25ca1d90d697bea2c0",
    "path": "items/hnrss-org/2026/11/2026-11-05-alpine-linux-security-advisory-openssh-server-password.md",
    "permalink": "https://github.com/aymericbeaumet/aggr-instance/blob/20068632b65d2830a2d54f25ca1d90d697bea2c0/items/hnrss-org/2026/11/2026-11-05-alpine-linux-security-advisory-openssh-server-password.md"
  },
  "id": "urn:aggr:item:faa3b3b6eb5cb0c3b37b7c1ea366b0f24f1aada2",
  "isBasedOn": {
    "@id": "https://alpinelinux.org/posts/2026-11-05-openssh-password-authentication-bypass/"
  },
  "mainEntity": {
    "@id": "https://alpinelinux.org/posts/2026-11-05-openssh-password-authentication-bypass/",
    "@type": "CreativeWork",
    "archivedAt": {
      "@id": "https://aggr.aymericbeaumet.com/items/hnrss-org/2026-11-05-alpine-linux-security-advisory-openssh-server-password/#webpage"
    },
    "author": [
      {
        "@type": "Person",
        "name": "pantalaimon"
      }
    ],
    "dateModified": "2026-11-05T14:44:20+00:00",
    "datePublished": "2026-11-05T14:44:20+00:00",
    "headline": "Alpine Linux Security Advisory: OpenSSH-server password authentication bypass",
    "image": {
      "@type": "ImageObject",
      "caption": null,
      "height": 90,
      "url": "https://alpinelinux.org/alpinelinux-logo.svg",
      "width": 160
    },
    "timeRequired": "PT5M",
    "url": "https://alpinelinux.org/posts/2026-11-05-openssh-password-authentication-bypass/",
    "wordCount": 1097
  },
  "name": "Archived snapshot: Alpine Linux Security Advisory: OpenSSH-server password authentication bypass",
  "preview": {
    "alt": null,
    "color": null,
    "height": 90,
    "placeholder": {
      "data_url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=",
      "hash": ""
    },
    "url": "https://alpinelinux.org/alpinelinux-logo.svg",
    "width": 160
  },
  "reading_minutes": 5,
  "replicated_at": null,
  "source": "hnrss-org",
  "source_name": "Hacker News: Front Page",
  "summary": null,
  "tags": [],
  "temporalCoverage": "2026-11-05T17:57:26.867095589+00:00",
  "title": "Alpine Linux Security Advisory: OpenSSH-server password authentication bypass",
  "url": "https://aggr.aymericbeaumet.com/items/hnrss-org/2026-11-05-alpine-linux-security-advisory-openssh-server-password/",
  "word_count": 1097
}