如何在不杀死 gio 的情况下使用 Kerberos 凭据挂载 Samba 共享?

如何在不杀死 gio 的情况下使用 Kerberos 凭据挂载 Samba 共享?

有关详细信息,请参阅以下 shell 交互。总而言之,在干净启动的情况下,gio 会请求用户名和密码,而不是使用 Kerberos 凭据。如果我先终止 gvfs,我可以使用 Kerberos 身份验证进行挂载、卸载和重新挂载。

我正在运行最新的 Ubuntu 22.04。我发现https://answers.launchpad.net/ubuntu/+source/gvfs/+question/703483但在本例中,我没有在 URI 中指定用户名或域。我尝试了https://wiki.gnome.org/Projects/gvfs/debugging但运气不佳,因为一旦 gvfs 重新启动,这种行为就会消失。添加环境变量并/etc/environment没有给我更多的调试输出。gvfsd-smb手动运行会因错误“错误安装:后端类型无效”而停滞

# 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:~$

相关内容