Article 50YEG Automatic mounting of shared folders on user login

Automatic mounting of shared folders on user login

by
borzov
from LinuxQuestions.org on (#50YEG)
I've added a Linux machine to a Windows domain and am in the process of finetuning it. So far I was able to solve most problems on my own. But this thing got me puzzled. So, there is a shared folder on one of our servers (WinServer2003). I mounted it using this command and it works fine:
Quote:
sudo mount -t cifs //192.168.0.2/media /mnt/share -o domain=<domain>,username=<domain user>,password=<password>,iocharset=utf8,file_mode=0777,dir_mode=0777,vers=1.0
Now I want it to mount automatically every time this user logs in. I installed libpam-mount and put this in /etc/security/pam_mount.conf.xml:
Quote:
<pam_mount>

<debug enable="1" />
<logout wait="500000" hup="1" term="1" kill="1" />
<mkmountpoint enable="1" remove="true" />
<volume fstype="cifs" server="192.168.0.2"
path="media" mountpoint="/mnt/share"
options="domain=<domain>,username=<domain user>,iocharset=utf8,file_mode=0777,dir_mode=0777,sec=krb5i,vers=1.0" />

</pam_mount>
And it doesn't work. The log file says this:
Quote:
(pam_mount.c:365): pam_mount 2.16: entering auth stage
(pam_mount.c:568): pam_mount 2.16: entering session stage
(mount.c:267): Mount info: globalconf, user=localadmin <volume fstype="cifs" server="192.168.0.2" path="media" mountpoint="/mnt/share" cipher="(null)" fskeypath="(null)" fskeycipher="(null)" fskeyhash="(null)" options="domain=<domain>,username=<domain user>,iocharset=utf8,file_mode=0777,dir_mode=0777,sec=krb5i,vers=1.0" /> fstab=0 ssh=0
(mount.c:664): Password will be sent to helper as-is.
command: 'mount' '-t' 'cifs' '//192.168.0.2/media' '/mnt/share' '-o' 'username=localadmin,uid=1000,gid=1000,domain=<domain>,username=<domain user>,iocharset=utf8,file_mode=0777,dir_mode=0777,sec=krb5i,vers=1.0'
(mount.c:72): Messages from underlying mount program:
(mount.c:76): mount error(524): Unknown error 524
The only difference I see is when I do it manually I use sudo. One recommendation I saw was to add cruid=%(USERUID) in the options but that doesn't help either. Now I'm officially out of ideas.

PS. I probably should have posted this in Network but I am new to Linux after all.latest?d=yIl2AUoC8zA latest?i=YxBXSey-eX4:_8B2xoQJO30:F7zBnMy latest?i=YxBXSey-eX4:_8B2xoQJO30:V_sGLiP latest?d=qj6IDK7rITs latest?i=YxBXSey-eX4:_8B2xoQJO30:gIN9vFwYxBXSey-eX4
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments