Score:0

Ubuntu 18.04 multi-AD-User mount share in /home

cn flag

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 ?

in flag
Is there a reason you are not using autofs?
TL_Arwen avatar
cn flag
Because I wasn't aware of autofs. xD I'll test it on my test machine.
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.