Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yescrypt user passwords do not function #147312

Closed
bbjubjub2494 opened this issue Nov 24, 2021 · 7 comments
Closed

yescrypt user passwords do not function #147312

bbjubjub2494 opened this issue Nov 24, 2021 · 7 comments
Labels
0.kind: bug 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md

Comments

@bbjubjub2494
Copy link
Member

Describe the bug

When setting roots hashedPassword to a yescrypt hash, login becomes seemingly impossible even with the correct password. All else being equal, sha512crypt does not exhibit this problem.

Steps To Reproduce

Steps to reproduce the behavior:

  1. build this virtual machine: https://gist.github.com/lourkeur/771d190aeb026dba2a60897eab90de57
  2. log in as root with password test
  3. Womp womp

Expected behavior

Access should be granted iff the password is correct.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

This is a bit concerning given that yescrypt is now the mkpasswd default since #143661.

Should pam be built with the withLibxcrypt flag? If so how?

Notify maintainers

For pam+libxcrypt interaction @dottedmag

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
output here

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
@Artturin
Copy link
Member

Related #112371

@Artturin
Copy link
Member

If yescrypt is now the default then I consider this a release blocker as we recommend mkpasswd in the manual

@amarshall

@bbjubjub2494
Copy link
Member Author

If yescrypt is now the default then I consider this a release blocker as we recommend mkpasswd in the manual

@amarshall

That might not be true with passwd, but for declarative passwords yes. I think for installation, the manual is still imperative, correct?

@amarshall
Copy link
Member

I can at least confirm that enabling withLibxcrypt in linux-pam allows login with yescrypt-hashed passwords. I’m not certain the broader implications of that change, but it’s probably a long-term goal. FWIW the users-groups module presently warns if a yescrypt hash is configured.

Where in the manual does it recommend bare mkpasswd? In NixOS installation it has mkpasswd -m sha-512.

@dottedmag
Copy link
Contributor

dottedmag commented Nov 26, 2021

Enabling libxcrypt in linux-pam makes at least login and SSH accept yescrypt-hashed passwods.

I'm not sure about the rest of the system: there is too much use of libcrypt.so (see the file attached to #112371) to be sure that all other packages don't access /etc/shadow directly.

@Artturin
Copy link
Member

I can at least confirm that enabling withLibxcrypt in linux-pam allows login with yescrypt-hashed passwords. I’m not certain the broader implications of that change, but it’s probably a long-term goal. FWIW the users-groups module presently warns if a yescrypt hash is configured.

Where in the manual does it recommend bare mkpasswd? In NixOS installation it has mkpasswd -m sha-512.

Ah nevermind then it's not as urgent now

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 19, 2022
@mweinelt
Copy link
Member

Fixed in #195271.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Projects
None yet
Development

No branches or pull requests

5 participants