-
Notifications
You must be signed in to change notification settings - Fork 34
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
dracut-sshd-networkmanager subpackage #69
Conversation
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 <[email protected]>
99sshd-auto-networkmanager adjusts nm-initrd.service to run for dracut-sshd. - If config is lacking auto DHCP ethernet in the same manner as rootfs NetworkManager. - Clean network teardown prior to switchroot avoids conflicts and gives OS full control. - Settings could be overriden by copying ifcfg or nmconnection settings into the initrd. Fixes: Issues gsauthof#63 gsauthof#68 Signed-off-by: Warren Togami <[email protected]>
auto DHCP and also config files if the admin includes it during dracut.
Hm, actually, it includes that other pull-request which makes it harder to review. So do I understand it correctly that with this pull-request installing the new subpackage would be equivalent to adding
to the kernel command line? |
Signed-off-by: Warren Togami <[email protected]>
Signed-off-by: Warren Togami <[email protected]>
Oops. If you really need it I can break it apart. But I would prefer not to especially as I got review from another developer and included an improvement to the shadow fixup here. Then I added packaging cleanups for both ...
neednet yes. ip=dhcp no. By deleting the I'm also told |
Just confirmed that the network is active after switchroot with |
If you'd prefer we could close #67 and rename this PR to "Make it work automaticalliy on Fedora and RHEL". Basically, others have been applying manual hacks to dracut-sshd to make it work in past years. These problems stopped me from using it until now. I'm cleaning up what I see to make it as automatic as possible. |
Confirmed this works perfectly with Rocky 9.2 and Rocky 8.8 x86_64 minimal install. |
Please hold. I'm rebasing this PR to remove #67. |
I see. To be honest, I find it wild that NetworkManager is so badly confused by an interface being already up such that it can't continue with it's configuration and one has to make sure that interfaces are down before the NM service start. However, I don't think that dracut-sshd is the right place to collect random hacks to work around network manager issues. Since it's already an extra module you can easily maintain it via an addon package, outside of dracut-sshd and/or fix the alleged networkmanager issues at the source. |
Well, I think it's part of any package to adapt to make the user experience better, and what you call random hacks, for me are workarounds that make the package work ootb. So yeah, I think it is the right place |
systemd/systemd#27791 Sure this might be fixed in Fedora 39. But this sort of change may never be applied to past enterprise distros supported until 2029 and 2032. Meanwhile with simple config changes NetworkManager works smoothly in all these distros. I ask that you please reconsider. Otherwise we will need to maintain this subpackage as a separate project. That is more of a maintenance burden. I also ask that you please do not expect users to switch their rootfs to networkd. We're quite happy with the default NetworkManager. It was a pleasant surprise to learn that NetworkManager already works so well in initramfs across the old and difficult to change distros. |
Your attitude is expecting everyone else to change without acknowledging there are several other valid ways of using Linux. If #14 is to ever be achieved it would require tighter integration with the way these distros do things. It's quite OK to include Fedora/RHEL specific config adjustments. Fedora does patch things in their own .src.rpm to suit its own needs when there is a difference of opinion with upstream. It would however be a lower maintenance burden if we could instead agree something like #69 as a subpackage would be quite harmless to other users of dracut so why not include it upstream? Respectfully, I feel your expectation that everyone else should change to be frustrating. It would be silly to maintain a perma-fork over something as harmless as #69. I feel the way about #67. |
Going forward we're thinking three scenarios.
We're leaning towards maintaining a parallel fork of
This path is more likely to result in something suitable for inclusion in Fedora. I'd prefer to maintain all of this in the upstream project with you. I hope you would reconsider. I am not proposing anything that changes things for other users. |
wtogami wrote:
I know that it's by design. But then your special bridge setup doesn't work anymore with NetworkManager, no?
Another straw man.
However, note that networkd doesn't tear down interfaces when it's stopped, by design. So we are talking about two things here, stopping a service and tearing down interfaces.
Building straw men seems to be your thing, Apparently you aren't interested in an honest discussion.
Please continue to mansplain my attitude to me. I can't stop you from forking for irrelevant reasons. As you see from my current README, especially the Related Work Section I don't have a problem linking to alternate approaches and alternatives. However, your addon would only be of interest to a minority of NetworkManager users, |
This module enables dracut network-manager settings for dracut-sshd.
in the same manner as rootfs NetworkManager.
thereby allowing the OS full control of networking config.
settings into the initrd. e.g. static IP's
Fixes: Issues #63 #68 (the latter is a very serious bug with systemd-networkd)
This PR is built on top of #67. I expect #67 is uncontroversial while you maybe want this PR to be adjusted.
Why the new subpackage?
An rpm could easily auto-configure networkmanager to just work as expected for dracut-sshd. However I anticipate that type of change might be too much of a surprise to some users. Hence the separate subpackage applies the necessary config and makes it work automatically in the majority of situations.
Tested Operating Systems
Fedora 38
dracut-059-3.fc38.x86_64
NetworkManager-1.42.6-1.fc38.x86_64
openssh-server-9.0p1-15.fc38.x86_64
Rocky 8.8 minimal
Rockky 9.2 minimal
How to Test
https://fedorapeople.org/~wtogami/a/2023/dracut-sshd-successful-networkmanager-shutdown-before-switchroot.txt
Check
journalctl -b
after a successful boot. You should see NetworkManager and sshd deactivating prior to switchroot like in this log.