I have an Ubuntu server that is joined to our windows domain. Users login via SSH using AD creds. I have a script that allows me to mount a windows share using cifs.
sudo mount.cifs //server/$1 /home/DOMAIN/$1/D -o user=$1,uid=$1,gid=domain\ users
I then have this entered in my /etc/bash.bashrc
#If ~/D does not exist, create it
if [ ! -d ~/D ]; then
mkdir ~/D
fi
#Mount D drive to ~/D
sudo /usr/local/bin/mountsamba.sh $USER
What I am trying to do is get it so it doesn't ask for the password and just uses the credentials that I use for logging into the server.