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/[email protected]/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 ?