Repository navigation
Fix Kali/Debian join: sudo lockout from libsss-sudo and missing sssd - #124
Merged
Merged
Conversation
- libsss-sudo from sssd 2.10+ (Debian sid / Kali rolling) writes "sudoers: sss" to /etc/nsswitch.conf when no sudoers line exists, dropping sudo's implicit "files" source. Every following sudo then fails with "root is not in the sudoers file" and the join aborts right after the package step. Add fix_nsswitch_sudoers and call it before/after installing libsss-sudo and in the final auth steps (replaces the exact-match sed that missed this case). - sssd is not in Kali rolling / Debian testing. ensure_sssd_available offers to add Debian sid as a pin-100 apt source for it. - ntp and policykit-1 no longer exist: fall back to ntpsec and polkitd.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Running
ADconnection.shon current Kali rolling (2026.2, arm64) fails beforerealm join:libsss-sudofrom sssd 2.10+ (Debian sid) createssudoers: sssin/etc/nsswitch.confwhen nosudoers:line exists (Kali and Debian ship without one). That drops sudo's implicitfilessource, so every followingsudoin the script fails withroot is not in the sudoers file. The existingsed 's/sudoers: files sss/.../'only matches the exact old format and runs too late, in the final auth step.sssd/libsss-sudopackage at all. It is still in Debian sid (2.13.1).ntpandpolicykit-1have no installation candidate any more.Fix
fix_nsswitch_sudoers: pins the sudoers source tofiles(the script keeps its rules in/etc/sudoers.d). It is called before and after installinglibsss-sudo(kalijoin, debianclient, raspberry) and replaces the exact-matchsedin the final auth functions. It runs through a newas_roothelper that doesn't need sudo when the script already runs as root.ensure_sssd_available: ifsssdhas no apt candidate, offers to add Debian sid as a pin-100 source, so only packages the distro lacks (sssd) come from sid. Called in kalijoin and debianclient.ntp→ntpsecandpolicykit-1→polkitd.Testing
bash -npasses.fix_nsswitch_sudoersunit-tested on temp files with no line,sudoers: sss,sudoers: files sssandsudoers: files: each ends with exactly onesudoers: filesline and is idempotent.gode.lan). A dry run of the sid pin pulled only the sssd packages from sid, with no removals.realm joinand final auth on Kali yet.