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

RFE: Root password #40

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

RFE: Root password #40

wants to merge 2 commits into from

Conversation

danbst
Copy link
Contributor

@danbst danbst commented Oct 10, 2019

generate random password for root as initial configuration

Some cloud providers allow web console login (Hetzner Cloud, for example).
You can then login and fix network issues (if any).

This change generates a password for root, so it is 1 step easier to do.

(this includes #39)

This helps Hetzner Cloud, which doesn't populate routes by
default and thus network doesn't work.

Fixes elitak#25
Some cloud providers allow web console login (Hetzner Cloud, for example).
You can then login and fix network issues (if any).

This change generates a password for root, so it is 1 step easier to do.
@elitak
Copy link
Owner

elitak commented Oct 11, 2019

Make this a non-default option activated by a flag or variable. Having the root password in plaintext in world-readable /etc/nixos is unsafe. Use echo $randpwd | mkpasswd -sm sha-512 and the hashedPassword option, instead. That way, the plaintext password is gone once the system is rebooted.

Also, why does pipefail need to be turned off for the generation?

@danbst
Copy link
Contributor Author

danbst commented Oct 11, 2019

Make this a non-default option activated by a flag or variable.

Ok, makes sense to create a special --debug parameter, which will add this password automatically and pause before reboot.

I also wonder which other cloud providers (except Hetzner Cloud) can do web console login to server. If none, then this feature is too specialized (inapplicable in general).

@danbst
Copy link
Contributor Author

danbst commented Oct 11, 2019

Also, why does pipefail need to be turned off for the generation?

Not sure. I think this is because head causes Broken pipe (breaks pipe in the middle of operation). I've seen that once in the wild (NixOS/nixpkgs#56958 (comment))

@elitak
Copy link
Owner

elitak commented Oct 13, 2019

I prefer the || true idiom, since it takes 2 fewer lines. I also suggest making the option --generate-root-password or something more suggestive than --debug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants