0

I have an Ubuntu 18.04 server which is joined to our windows domain. I have set up so users can log in to the server using their AD creds which is working great. I also set up script that mounts a windows share automatically at login.

sudo mount -t cifs //tiberius/$1 /home/$1@molienergy.com/D -o user=$1,cruid=$1,sec=krb5,uid=$1,gid=domain\ users

This is a script that runs at login. In my /etc/bash.bashrc, I have this:

#If ~/D does not exist, create it
if [ ! -d ~/D ]; then
  mkdir ~/D
fi
#Mount D drive to ~/D
if [ "$EUID" -ne 0 ] && [ "$EUID" -ne 1000 ]; then
        sudo /usr/local/bin/mountsamba.sh $USER
fi
#Disconnect mount on session close
finish() {
        sudo /etc/bash.bash_logout
        }
        trap finish SIGHUP


if [ -f /etc/bash.bash_aliases ]; then
        /etc/bash.bash_aliases
fi 

The share seems to mount fine which is great, but I am getting these errors in /var/log/syslog:

[1477629.820060] CIFS VFS: Verify user has a krb5 ticket and keyutils is installed
[1477629.820061] CIFS VFS: Send error in SessSetup = -126

These logs make it very hard to see if there are any big issues in the server. I'm just trying to get these shares to mount automatically without users having to put in their password multiple times at log in. This should work since the server is connected to AD. I'm guessing this has to do with keytab and when a user changes their password ?

TL_Arwen
  • 69
  • 6

1 Answers1

0

After a long overdue period, I finally figured out what the issue was. Turned out the krb5 keys were expiring and users were not signing out of the ssh sessions. So after I put a timeout on SSH sessions, the problem disappeared

TL_Arwen
  • 69
  • 6