igel
December 6, 2022, 7:25pm
1
system: "x86_64-linux"
host os: Linux 5.19.9, NixOS, 22.05 (Quokka), 22.05.3242.72783a2d0db
multi-user?: yes
sandbox: yes
version: nix-env (Nix) 2.8.1
channels(root): "home-manager-22.05.tar.gz, nixos-22.05, nixos-hardware"
channels(usera): ""
nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos
Generally speaking, you should use the username root and the password you specified at the very end of the installation process.
Alternatively, you can create a user in your configuration.nix and supply a hashed password. However, that isn’t required. If you want to try that instead you can do it like this:
users.users.dalto = {
isNormalUser = true;
hashedPassword = "$6$sxrNsu3.EwRXYAAG$flowzjKcDepdPSqA5d4Y6y/HzupxndqmrcjwExbR7H05PgAOo91Q2yXGsdmavXRZpM8ROEcN9pVNhnmZA2NIo.";
ext…
mkpasswd -m sha-512 password
How to use it currently ?
mkpasswd -m sha-512 password_ZZ_11_*
usage: mkpasswd [args] [user]
where arguments are:
-l # (length of password, default = 9)
-d # (min # of digits, default = 2)
-c # (min # of lowercase chars, default = 2)
-C # (min # of uppercase chars, default = 2)
-s # (min # of special chars, default = 1)
-v (verbose, show passwd interaction)
-p prog (program to set password, default = passwd)
user name does not work either
old 22.05 config/hash is not working in 22.11
NobbZ
December 6, 2022, 8:05pm
2
Seems to work for me:
$ mkpasswd -m sha-256 'secret_passw*rd'
$5$fdx2qFKZTY5l8RGc$XhIK.ifraStCJXF78xEu2ntjw2iDn/PU98fFzYPMyi.
Though seems as if you missed to quote/escape the asterisk, so it got interpreted as a glob by your shell.
tejing
December 6, 2022, 8:54pm
3
You didn’t escape the *
from the shell. That’s probably your issue.
I recommend not supplying the password as an argument, though, as that puts it in your shell history. Just do mkpasswd -m sha-512
, and type in your new password at the prompt.
3 Likes
igel
December 7, 2022, 7:56am
4
tejing:
mkpasswd -m sha-512
mkpasswd -m sha-512
usage: mkpasswd [args] [user]
where arguments are:
-l # (length of password, default = 9)
-d # (min # of digits, default = 2)
-c # (min # of lowercase chars, default = 2)
-C # (min # of uppercase chars, default = 2)
-s # (min # of special chars, default = 1)
-v (verbose, show passwd interaction)
-p prog (program to set password, default = passwd)
mkpasswd -m sha-256 'secret_passw*rd'
usage: mkpasswd [args] [user]
where arguments are:
-l # (length of password, default = 9)
-d # (min # of digits, default = 2)
-c # (min # of lowercase chars, default = 2)
-C # (min # of uppercase chars, default = 2)
-s # (min # of special chars, default = 1)
-v (verbose, show passwd interaction)
-p prog (program to set password, default = passwd)
tejing
December 7, 2022, 8:00am
5
Huh… I don’t think you’re using the right mkpasswd
. Mine works completely differently than that usage text suggests. What package is it coming from? It should be pkgs.mkpasswd
.
tejing
December 7, 2022, 8:03am
6
$ nix shell nixpkgs\#expect -c mkpasswd -m sha-512
usage: mkpasswd [args] [user]
where arguments are:
-l # (length of password, default = 9)
-d # (min # of digits, default = 2)
-c # (min # of lowercase chars, default = 2)
-C # (min # of uppercase chars, default = 2)
-s # (min # of special chars, default = 1)
-v (verbose, show passwd interaction)
-p prog (program to set password, default = passwd)
looks like yours is coming from pkgs.expect
.
1 Like
igel
December 7, 2022, 8:08am
7
looks like you are right
(Now I have see if I get a nixos-rebuild without to lose the Nix-Channels in the paths … to have a working OS … mh, no first I have to get rid of Home-Manager which destroyed-OS my Laptop already …)