News for hackers. Stuff that matters.
Re:Sshole by scandinavian on Thursday November 05, 2026 @07:59AM (#50378561)
Did anyone get it to work? I tried on the official alpine docker image, enabled password login for root. The shadow entry has ! as password by default, this didn't work with a > 256 character password (i also did passwd -l which also does !). I manually changed it to * and it still didn't work.

Am I doing anything wrong here?

OpenSSH_10.3p1, OpenSSL 3.5.9 29 Sep 2026 PRETTY_NAME="Alpine Linux v3.24"

Re:Sshole by atmosx on Thursday November 05, 2026 @08:14AM (#50378705)
Nope, wasn’t able to reproduced it in my firecracker VM, which isn’t publicly accessible anyway.
Re:Sshole by emayljames on Thursday November 05, 2026 @08:16AM (#50378722)
Did you try one incorrect standard password fail first?
Re:Sshole by f311a on Thursday November 05, 2026 @08:22AM (#50378779)
As far as I understand, it wont work on default setups. You need musl-c, no pam and openssh.
Re:Sshole by zamadatix on Thursday November 05, 2026 @08:43AM (#50378967)
In Alpine, these would all be the case for an out of the box install with openssh added unless you specifically install openssh-server-pam and configure sshd_config to use PAM (Alpine is already musl-c based).
Re:Sshole by Aachen on Thursday November 05, 2026 @09:25AM (#50379446)
Doesn't it also need a user to be added with a password entry?

I only ever see Alpine Linux used for containers which don't need accounts with interactive user logins, which is not to say it doesn't exist, just that it doesn't seem like Alpine comes with all preconditions met out of the box

Re:Sshole by zamadatix on Thursday November 05, 2026 @10:20AM (#50380214)
Isn't it the opposite, accounts which have no password and hence had * instead of a hash? I.e. the bug is:

> accounts that should never take a password at all (root, your key-only deploy user, ldap users, the default user on alpine's aws and azure images) take any password longer than 256 characters.

But the correct behavior was supposed to be:

> a * isn't a hash, so no password can match it. unix still does this today'

> and if the field is just *? there's nothing to match. type whatever you want, it's never getting you in

Re:Sshole by Aachen on Friday November 06, 2026 @06:03AM (#50390846)
The part in your edit is indeed what I was referring to, sorry that could have been clearer
Re:Sshole by q3k on Thursday November 05, 2026 @08:29AM (#50378831)
Also didn't have much luck on Alpine 3.20.10 with OpenSSH_9.7p1.

Last two entries in /etc/shadow:

    test:*:20762:0:99999:7:::
    q3k:$6$snip.GgDQNTrqqX.A0:20762:0:99999:7:::
SSHing into test@ with one 'wrong' password then one 'long' password doesn't work. I have UsePAM no and PasswordAuthentication yes in my sshd_config.
Re:Sshole by hagbard_c on Thursday November 05, 2026 @08:35AM (#50378896)
No, didn't work for me open OpenWRT x64 running in a container but that is probably 'cause I'm using dropbear instead of openssh-server. That's what OpenWRT uses by default so the impact there will be minimal assuming that most installations don't change to openssh-server - it isn't installed by default.
Re:Sshole by necovek on Thursday November 05, 2026 @05:23PM (#50385348)
On top of OpenWRT on my router (running 25.12) running dropbear instead of openssh-server, I also do not have any accounts in /etc/passwd|/etc/shadow with "*" for a password hash and an actual shell (all are set to /bin/false).
Re:Sshole by markuman123 on Thursday November 05, 2026 @08:56AM (#50379094)
It's because alpine has updated all openssh-server packages already. Even from EOL alpine versions.
Re:Sshole by justinsaccount on Thursday November 05, 2026 @09:02AM (#50379178)
oooh, that'll do it.

Didn't notice that the openssh-server-10.3_p1-r2 was released today.

Re:Sshole by bonyt on Thursday November 05, 2026 @09:06AM (#50379217)
Ahh! Wasn't working on 3.16, which does indeed have an updated package.

But, got it to work on 3.15 - which requires changing the ! to a * in the shadow file in addition to other steps (making another user with a hash, setting PermitRootLogin to yes, etc.).

https://pkgs.alpinelinux.org/package/v3.16/main/x86_64/opens... Build time 2026-11-05 06:53:46

Re:Sshole by markuman123 on Thursday November 05, 2026 @09:21AM (#50379403)
Re:Sshole by justinsaccount on Thursday November 05, 2026 @09:00AM (#50379159)
I can't reproduce it either. I used alpine:3.24.1 and openssh is openssh-server-10.3_p1-r2

I tried adding PermitRootLogin yes and PasswordAuthentication yes. Tried adding another user with a valid password.

Verified shadow entry has a *. Can't login as root or a test user. Tried another incorrect password first as well.

Re:Sshole by ahepp on Friday November 06, 2026 @05:30PM (#50399363)
In Unixese, shadow having ! means the account is "locked", right? I haven't tried the steps to replicate so maybe they did replace the * with a ! or something, but I would try making sure the account is not locked.