Hide Forgot
I have a personal FreeIPA domain set up. On one of my laptops, which is running F23, I can't seem to sudo when the machine is offline (or on the internet but cannot reach the FreeIPA server, e.g. not running on my local network). I can sudo just fine as long as I can reach the server, but offline caching via sssd does not seem to work. I have this in /etc/nssswitch.conf : sudoers: sss note - not "files sss". I have this /etc/sssd/sssd.conf: --------------- [domain/happyassassin.net] cache_credentials = True krb5_store_password_if_offline = True ipa_domain = happyassassin.net id_provider = ipa auth_provider = ipa access_provider = ipa ipa_hostname = xps13.happyassassin.net chpass_provider = ipa ipa_server = _srv_, id.happyassassin.net ldap_tls_cacert = /etc/ipa/ca.crt # for SUDO via FreeIPA sudo_provider = ldap ldap_uri = ldaps://id.happyassassin.net ldap_sudo_search_base = ou=sudoers,dc=happyassassin,dc=net ldap_sasl_mech = GSSAPI ldap_sasl_authid = host/xps13.happyassassin.net ldap_sasl_realm = HAPPYASSASSIN.NET krb5_server = id.happyassassin.net [sssd] services = nss, pam, ssh, sudo config_file_version = 2 domains = happyassassin.net [nss] [pam] [sudo] [autofs] [ssh] [pac] ----------------------- I think if I make nsswitch.conf 'files sss' it would work, but it would be kinda cheating - it'd just work because my user happens to be in the wheel group and /etc/sudoers allows anyone in wheel to sudo. So it wouldn't be using FreeIPA at all in that case. AIUI, this is supposed to work via sssd.
(In reply to Adam Williamson from comment #0) > I have a personal FreeIPA domain set up. On one of my laptops, which is > running F23, I can't seem to sudo when the machine is offline (or on the > internet but cannot reach the FreeIPA server, e.g. not running on my local > network). I can sudo just fine as long as I can reach the server, but > offline caching via sssd does not seem to work. > > I have this in /etc/nssswitch.conf : > > sudoers: sss > > note - not "files sss". I have this /etc/sssd/sssd.conf: > > --------------- > > [domain/happyassassin.net] > > cache_credentials = True > krb5_store_password_if_offline = True > ipa_domain = happyassassin.net > id_provider = ipa > auth_provider = ipa > access_provider = ipa > ipa_hostname = xps13.happyassassin.net > chpass_provider = ipa > ipa_server = _srv_, id.happyassassin.net > ldap_tls_cacert = /etc/ipa/ca.crt > > # for SUDO via FreeIPA > sudo_provider = ldap > ldap_uri = ldaps://id.happyassassin.net > ldap_sudo_search_base = ou=sudoers,dc=happyassassin,dc=net > ldap_sasl_mech = GSSAPI > ldap_sasl_authid = host/xps13.happyassassin.net > ldap_sasl_realm = HAPPYASSASSIN.NET > krb5_server = id.happyassassin.net > You need't use "sudo_provider = ldap" with freeipa since sssd-1.10.0 > [sssd] > services = nss, pam, ssh, sudo > config_file_version = 2 > > domains = happyassassin.net > [nss] > > [pam] > > [sudo] > > [autofs] > > [ssh] > > [pac] > > ----------------------- > > I think if I make nsswitch.conf 'files sss' it would work, but it would be > kinda cheating - it'd just work because my user happens to be in the wheel > group and /etc/sudoers allows anyone in wheel to sudo. So it wouldn't be > using FreeIPA at all in that case. AIUI, this is supposed to work via sssd. What is a difference between output of "sudo -l" when sssd in connected to IPA and when sssd is offline?
sorry, forgot to check on this, will do it soon.
jeez, I've been hating this bug for like six months and now the *one* time I go to reproduce it intentionally for a needinfo, it mysteriously disappears? What the hell? I just turned off my wifi, tried rebooting with it turned off, and sudo is working like a champ. Bizarre. I really doubt this bug is actually fixed, though, so I'm not gonna close it yet. Next time it happens I'll try and remember to run sudo -l. If it somehow really does stop happening in the wild I'll close the bug after a bit.
oh, on the 'sudo_provider=ldap' bit - can i drop that whole chunk you quoted, or only the sudo_provider line?
(In reply to Adam Williamson from comment #4) > oh, on the 'sudo_provider=ldap' bit - can i drop that whole chunk you > quoted, or only the sudo_provider line? You can drop the whole block with the ldap_ and krb5_ options following the comment that says "# for SUDO via FreeIPA"
Adam, are you able to reproduce this bug? or should we close it?
sorry, yes, it still happens all the time. sudo -l output is not very enlightening, just: [adamw@xps13 ~]$ sudo -l [sudo] password for adamw: User adamw is not allowed to run sudo on xps13. When I'm on the network: [adamw@xps13 fedora_nightlies (master %)]$ sudo -l [sudo] password for adamw: User adamw may run the following commands on xps13: (ALL) ALL
It would be really useful to collect sssd debug logs along with sudo debug logs to diagnose the issue: https://fedorahosted.org/sssd/wiki/HOWTO_Troubleshoot_SUDO
I'm getting to it. If there's anything else you might need can you please list it now? It's easier for me to get it all at once than have to keep coming back to this bug to get something different.
Sigh, so once again this one goes away when I try to look at it in detail. Let me try and remember the sequence of events here: 1. Started with my laptop on the network as usual 2. Disconnected from the network, tried to sudo, got denied 3. Removed now-unnecessary block from sssd.conf and added debugging statements there and to sudo.conf, restarted sssd, tried to sudo, go denied 4. Got back on the network, sudo worked again 5. Disconnected and tried to sudo immediately, it worked (no password) 6. Waited some time and tried to sudo again, still worked (prompted for password) 7. Rebooted, disconnected from network, tried to sudo, it worked (password prompt) So I do have logs with *one* instance of the failure case, but now I can't seem to trigger it again. I guess it's possible that removing the 'unnecessary' block from the sssd.conf changed things? I'll leave the debug statements in for now and see, once again, if this still happens when I travel...I'll also attach the logs, just for interest.
Created attachment 1153580 [details] sssd_sudo log
Created attachment 1153583 [details] sssd_happyassassin log
Created attachment 1153584 [details] sudo debug log
Hi, thank you for tha logs. I can see that sssd give rules to sudo for evaluation even when offline. Unfortunately the sudo logs doesn't contains information I'd like to see, do you have "Debug sudo /var/log/sudo_debug all@debug" in /etc/sudo.conf? Can you sent us how does the sudo rule look like (ipa sudorule-show)?
Still seeing this (laptop's on F24 at present). I've just added that line to sudo.conf . I'll get updated logs when I can.
This message is a reminder that Fedora 23 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 23. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '23'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 23 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.