Score:0

How do I mount a Samba share using Kerberos credentials without pkilling gio?

ca flag

Please see the following shell interaction for details. To summarize, with a clean boot, gio requests a user name and password instead of using Kerberos credentials. If I kill gvfs first, I can mount, unmount, and remount with Kerberos authentication.

I'm running up-to-date Ubuntu 22.04. I found https://answers.launchpad.net/ubuntu/+source/gvfs/+question/703483 but in this case I'm not specifying the username or domain in the URI. I tried the debugging techniques from https://wiki.gnome.org/Projects/gvfs/debugging but didn't have much luck because the behavior disappears as soon as gvfs restarts. Adding environment variables to /etc/environment didn't give me more debug output. Running gvfsd-smb manually stalls with an error "Error mounting: invalid backend type"

# valid Kerberos ticket is present
caleb@client:~$ klist
Ticket cache: FILE:/tmp/krb5cc_1005_muii0n
Default principal: [email protected]

Valid starting       Expires              Service principal
08/03/2023 16:48:55  08/04/2023 02:48:55  krbtgt/[email protected]
    renew until 08/04/2023 16:48:55
# gvfs running
caleb@client:~$ ps auxw | grep gvfs
gdm         1688  0.0  0.0 240640  7680 ?        Ssl  16:48   0:00 /usr/libexec/gvfsd
gdm         1703  0.0  0.0 380888  6336 ?        Sl   16:48   0:00 /usr/libexec/gvfsd-fuse /run/user/121/gvfs -f
gdm         1854  0.7  0.0 318148 11904 ?        Ssl  16:48   0:00 /usr/libexec/gvfs-udisks2-volume-monitor
gdm         1860  0.0  0.0 315200  7872 ?        Ssl  16:48   0:00 /usr/libexec/gvfs-afc-volume-monitor
gdm         1865  0.0  0.0 236580  6528 ?        Ssl  16:48   0:00 /usr/libexec/gvfs-mtp-volume-monitor
gdm         1870  0.0  0.0 237540  6720 ?        Ssl  16:48   0:00 /usr/libexec/gvfs-gphoto2-volume-monitor
gdm         1874  0.0  0.0 236628  6336 ?        Ssl  16:48   0:00 /usr/libexec/gvfs-goa-volume-monitor
caleb       2410  0.0  0.0 240640  7872 ?        Ssl  16:48   0:00 /usr/libexec/gvfsd
caleb       2420  0.0  0.0 380888  6528 ?        Sl   16:48   0:00 /usr/libexec/gvfsd-fuse /run/user/1005/gvfs -f
caleb       2496  0.1  0.0 327536 11712 ?        Ssl  16:48   0:00 /usr/libexec/gvfs-udisks2-volume-monitor
caleb       2543  0.0  0.0 315200  7680 ?        Ssl  16:48   0:00 /usr/libexec/gvfs-afc-volume-monitor
caleb       2548  0.0  0.0 236580  6336 ?        Ssl  16:48   0:00 /usr/libexec/gvfs-mtp-volume-monitor
caleb       2556  0.0  0.0 237540  6912 ?        Ssl  16:48   0:00 /usr/libexec/gvfs-gphoto2-volume-monitor
caleb       2560  0.0  0.0 236628  6336 ?        Ssl  16:48   0:00 /usr/libexec/gvfs-goa-volume-monitor
caleb       2741  0.0  0.0 388724  8832 ?        Sl   16:48   0:00 /usr/libexec/gvfsd-trash --spawner :1.3 /org/gtk/gvfs/exec_spaw/0
caleb       3134  0.0  0.0 162900  6144 ?        Ssl  16:48   0:00 /usr/libexec/gvfsd-metadata
caleb       3181  0.0  0.0   9208  2496 pts/0    S+   16:49   0:00 grep --color=auto gvfs
# trying to mount a Samba share asks for user + password
caleb@client:~$ gio mount -i 'smb://fileserver.samdom.example.com/users/'
Authentication Required
Enter user and password for share “users” on “fileserver.samdom.example.com”:
User [caleb]: ^C
# cancel, kill gvfs
caleb@client:~$ pkill gvfs
caleb@client:~$ ps auxw | grep gvfs
caleb       3225  0.0  0.0   9076  2304 pts/0    R+   16:49   0:00 grep --color=auto gvfs
# retry -- now Kerberos auth works fine
caleb@client:~$ gio mount -i 'smb://fileserver.samdom.example.com/users/'
# gvfs has been restarted, but gfvsd-smb is now in the list
caleb@client:~$ ps auxw | grep gvfs
caleb       3229  0.0  0.0 240616  7680 ?        Ssl  16:49   0:00 /usr/libexec/gvfsd
caleb       3234  0.0  0.0 380888  6336 ?        Sl   16:49   0:00 /usr/libexec/gvfsd-fuse /run/user/1005/gvfs -f
caleb       3236  0.0  0.0 327540 12096 ?        Ssl  16:49   0:00 /usr/libexec/gvfs-udisks2-volume-monitor
caleb       3247  0.0  0.0 315196  7680 ?        Ssl  16:49   0:00 /usr/libexec/gvfs-afc-volume-monitor
caleb       3252  0.0  0.0 236584  6144 ?        Ssl  16:49   0:00 /usr/libexec/gvfs-mtp-volume-monitor
caleb       3256  0.0  0.0 237540  6720 ?        Ssl  16:49   0:00 /usr/libexec/gvfs-gphoto2-volume-monitor
caleb       3260  0.0  0.0 236628  6336 ?        Ssl  16:49   0:00 /usr/libexec/gvfs-goa-volume-monitor
caleb       3265  0.0  0.0 460588 23808 ?        Sl   16:49   0:00 /usr/libexec/gvfsd-smb --spawner :1.106 /org/gtk/gvfs/exec_spaw/0
caleb       3323  0.0  0.0 314888  8448 ?        Sl   16:49   0:00 /usr/libexec/gvfsd-trash --spawner :1.106 /org/gtk/gvfs/exec_spaw/1
caleb       3485  0.0  0.0 163004  6336 ?        Ssl  16:49   0:00 /usr/libexec/gvfsd-metadata
caleb       3580  0.0  0.0   9076  2496 pts/0    S+   16:51   0:00 grep --color=auto gvfs
caleb@client:~$
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.