-
Notifications
You must be signed in to change notification settings - Fork 35
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
root user must be unlocked (* not ! in /etc/shadow) #19
Comments
This is needed to have dracut-sshd working gsauthof/dracut-sshd#19 Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
I confirm this helps. |
@champtar Do you have any other pointers for getting it to work on Fedora 31? |
It worked with an up to date F31 last weekend, maybe there is a new update since last weekend that broke something, I'll try when I have time. |
Thank you @champtar for sharing this. Do you know which dracut module is copying On a Fedora 31 machine of mine, initramfs doesn't contain an
|
@champtar it seems it was my partitioning that caused issues. I was able to reproduce my issue inside a VM and fixed it by changing the partition structure. |
@gsauthof see 3rd line
|
I see, my system was still on It was introduced by this commit: dracutdevs/dracut@32f68c1 So, I'm not sure how to deal with this issue. I mean you could argue that a system where the root user is locked, root also shouldn't be able to log into early boot. I don't know how common it is to set up a system without root password (and then use I always set up a password for root on my systems. From your point of view, is there something actionable that could/should be changed in this dracut-sshd module in regard to this issue? |
When using PAM |
Closing this issue because shadow checks are out-of-scope for dracut-sshd, in my opinion. |
For the last two decades Red Hat's distro has discouraged people from logging into the desktop as root. As a result many of us almost never login as root. We instead use ssh keys and sudo from non-root users. All of my systems have no root password. I am pretty sure I am not alone in this and thus find dracut-sshd to be broken. As for what to do about it ...
Unfortunately |
SSH pubkey login while the password is disabled is common on normal systems. That normally shows up in /etc/shadow as '^root:!:' Both '!' and '*' are invalid hashes denoting the password is disabled but sshd with "UsePAM no" differently interprets where '!' disallows logins despite a valid ssh pubkey. If you installed and manually enabled dracut-sshd networking you surely did not intend for it to deny ssh pubkey authentication. 99sshd-shadow-fixup runs after 99base had copied the /etc/shadow entry replacing the '!' character with '*' thereby allowing SSH pubkey login to work as intended. Fixes: gsauthof#19 Signed-off-by: Warren Togami <wtogami@gmail.com>
SSH pubkey login while the password is disabled is common on normal systems. That normally shows up in /etc/shadow as '^root:!:' Both '!' and '*' are invalid hashes denoting the password is disabled but sshd with "UsePAM no" differently interprets where '!' disallows logins despite a valid ssh pubkey. If you installed and manually enabled dracut-sshd networking you surely did not intend for it to deny ssh pubkey authentication. 99sshd-shadow-fixup runs after 99base had copied the /etc/shadow entry replacing the '!' character with '*' thereby allowing SSH pubkey login to work as intended. Fixes: gsauthof#19 Signed-off-by: Warren Togami <wtogami@gmail.com>
Well, Linux distributions in general have discouraged people from logging into a desktop environment as root since forever. I just installed Fedora 38 server via the official GUI installer and there it presents me with to menu points for root _and _ user account creation. Both are marked with an exclamation mark to direct the user entering their configuration menus. Forward progress is blocked until any of those items is configured. The root user creation item is even on top of the user creation, thus, the installer even encourages to consider creating a root account. (at least for people who are used to a left-to-right/top-to-bottom reading direction) When I enter the root user creation dialog I'm presented with this text:
The first option is pre-selected, but that's it. The wording doesn't strongly pushes a user into disabling the root account at all. Granted, it's possible to skip the root user creation item and just configure a normal user and continue with the installation. In that case the root account is disabled via I find it hilarious how such a system then has sudo credential caching enabled, by default. Besides, having a root account with a password allows for console repair login in situations where the normal network is down, the normal user authentication and/or NFS user homes are broken.
Do you use sudo with or without credential caching?
I'm sure that you aren't the only one. One can argue for some time about the semantics of It would be consequent for Fedora to patch openssh to use a different Sure, Fedora already claims that However, if you care strongly about this, creating an openssh issue in the fedora bugzilla is small effort and perhaps you can convince the openssh fedora packager to change it. Especially since |
Your argument is Red Hat is overall doing it wrong and we must convince them to change. Even if you're correct that is exceedingly difficult for a codepath that they outright declare is unsupported.
I am uncertain we could convince them to accept a |
wrtogami wrote:
I don't follow. In the part you cite I'm arguing that Fedora (a distribution which is co-authored by Redhat) doesn't push a user to disable the root account, strongly.
We will never know if you don't try.
Depends on your RHEL support contract. If you can't convince them you can still simply switch your locking method for your
Or simply set a strong password for your root account. |
SSH pubkey login while the password is disabled is common on normal systems. That normally shows up in /etc/shadow as '^root:!:' Both '!' and '*' are invalid hashes denoting the password is disabled but sshd with "UsePAM no" differently interprets where '!' disallows logins despite a valid ssh pubkey. If you installed and manually enabled dracut-sshd networking you surely did not intend for it to deny ssh pubkey authentication. 99sshd-shadow-fixup runs after 99base had copied the /etc/shadow entry replacing the '!' character with '*' thereby allowing SSH pubkey login to work as intended. Fixes: gsauthof#19 Signed-off-by: Warren Togami <wtogami@gmail.com>
SSH pubkey login while the password is disabled is common on normal systems. That normally shows up in /etc/shadow as '^root:!:' Both '!' and '*' are invalid hashes denoting the password is disabled but sshd with "UsePAM no" differently interprets where '!' disallows logins despite a valid ssh pubkey. If you installed and manually enabled dracut-sshd networking you surely did not intend for it to deny ssh pubkey authentication. 99sshd-shadow-fixup runs after 99base had copied the /etc/shadow entry replacing the '!' character with '*' thereby allowing SSH pubkey login to work as intended. Fixes: gsauthof#19 Signed-off-by: Warren Togami <wtogami@gmail.com>
OK you're correct. Red Hat used to more strongly discourage users from logging in to the desktop as root. Perhaps I haven't tried in years. There is no visible warning anymore. The installer still has an option to set a root password and it's valid to not set it. Perhaps many of us trained long ago continue to not ever set a root password. |
As mentioned before, there are two completely different things:
The way you are trying to to repeatedly mix those together is a typical straw man move.
Speak for yourself. |
SSH pubkey login while the password is disabled is common on normal systems. That normally shows up in /etc/shadow as '^root:!:' Both '!' and '*' are invalid hashes denoting the password is disabled but sshd with "UsePAM no" differently interprets where '!' disallows logins despite a valid ssh pubkey. If you installed and manually enabled dracut-sshd networking you surely did not intend for it to deny ssh pubkey authentication. 99sshd-shadow-fixup runs after 99base had copied the /etc/shadow entry replacing the '!' character with '*' thereby allowing SSH pubkey login to work as intended. Fixes: gsauthof#19 Signed-off-by: Warren Togami <wtogami@gmail.com>
Small PSA, just did a new Fedora 31 install this morning, and since pretty recently dracut now copy the
root:...
line from system/etc/shadow
toetc/shadow
in the initramfs, before there was noetc/shadow
in initramfssshd is launched with
UsePAM no
in the initramfs, so we need root not to be locked, ie you needroot:*:18343:0:99999:7:::
not
root:!:18343:0:99999:7:::
In my kickstart i was locking root using
usermod -p '!' root
, which allow me to login to the regular Fedora install, but not the initramfs sshd. It should have beenusermod -p '*' root
Quick check:
The text was updated successfully, but these errors were encountered: