I have an Ubuntu 21.10 pc joined to a Samba AD domain controller. Everything is working absolutely fine - Kerberos is working (can get tickets with kinit), winbind is working (can get info abount users and groups), I am able to log in to the system with domain credentials.
And mounting shares manually also works, both with Kerberos and ntlmssp authorization:
sudo mount -t cifs //server/path /mount/point -o username=USER,domain=DOMAIN,sec=ntlmssp
sudo mount -t cifs //server/path /mount/point -o username=USER,domain=DOMAIN,sec=krb5
Setting username like username=USER@DOMAIN works too.
The problem is I can't get pam_mount to work when a user logs in via gnome!
Using krb5 in pam_mount.conf.xml like this
<volume
fstype="cifs"
server="server"
path="path"
mountpoint="mount/point"
options="sec=krb5"
/>
Gives an error in auth.conf
(mount.c:72): mount error(126): Required key not available
Using ntlmssp in pam_mount.conf.xml like this
<volume
fstype="cifs"
server="server"
path="path"
mountpoint="mount/point"
options="sec=ntlmssp"
/>
Gives a different error in auth.conf
(pam_mount.c:173): conv->conv(...): Conversation error
After enabling debugging in pam_mount I can also see the exact mount command it is executing in auth.log and it is identical to the ones above which work, when I run them manually.
I've tried the following:
- played with mount options in different combinations: vers=3.0, _netdev,user,sec
- forced Kerberos to store tickets in files in /tmp/krb5cc_%u with pam_winbind config
- read a ton of forums
Any ideas?