Ubuntu Server: Mount shares with Kerberos

Hi@all,

I have an Ubuntu 20.04 server here that I have integrated into the domain via ADS join. The master is a UCS 5.0.1.

Unlike the Ubuntu desktops, I can’t use PAM_MOUNT here which dynamically includes the SAMBA shares when logging in. I have to do this via the /etc/fstab.

But for this I have to write the login data (user & password) in plain text into a file or the fstab itself. This is of course not nice.

My /etc/fstab:

//srv01.lan.example.com/Share    /data01/Share  cifs  rw,x-systemd.automount,x-systemd.device-timeout=10,_netdev,relatime,vers=3.1.1,fsc,cache=strict,uid=administrator,gid=domain\040users,file_mode=0660,dir_mode=0770,soft,nounix,serverino,mapposix,username=user123,password=password123    0       0

I have created the user ‘user123’ on the UCS. But as soon as I open the options:

sec=kerb5i
cruid=user123

the mount does not work anymore. It tries to create a wrong credential (file) in /tmp/krb5… is tried to be used.

Is there any way to use a permanent mount in fstab that uses the credentials of a defined user via Kerberos?

with best
sven

With kerberos it is very easy to mount share at login automaticly. It works on Desktop like KDE, also on SSH. Have a look @my howto’s:
https://deepdoc.at/dokuwiki/doku.php?id=server_und_serverdienste:automount_von_sambalaufwerken_beim_login_-_inkl._kerberos_und_nomachine_terminalserver

Mastodon