How to mount private network shares on login?
        Posted  
        
            by 
                bainorama
            
        on Ask Ubuntu
        
        See other posts from Ask Ubuntu
        
            or by bainorama
        
        
        
        Published on 2012-10-12T21:32:43Z
        Indexed on 
            2012/10/12
            21:48 UTC
        
        
        Read the original article
        Hit count: 303
        
I've read all the existing entries I could find on using pam_mount but none of them seem to work for me. I'm trying to automatically mount shares on my local NAS at user login time.
The usernames and passwords on my NAS shares match my local user name and password, but there is no LDAP/AD server.
My pam_mount.conf has the following:
<volume fstype="cifs" server="bain-brain" path="movies" user="*" sgrp="bains" mountpoint="/home/%(USER)/movies" options="user=%(USER),dir_mode=0700,file_mode=700,nosuid,nodev" />
When I login, I see the following in /var/log/auth.log:
Oct 13 10:21:26 bad-lattitude lightdm: pam_mount(misc.c:380): 29 20 0:20 / /home/alastairb/movies rw,nosuid,nodev,relatime - cifs //bain-brain/movies rw,sec=ntlm,unc=\\bain-brain\movies,username=alastairb,uid=1000,forceuid,gid=1000,forcegid,addr=10.1.1.12,file_mode=01274,dir_mode=0700,nounix,serverino,rsize=61440,wsize=65536,actimeo=1
The folder /home/alastairb/movies is present but empty (can't see the files which are on the NAS in the respective share folder).
In Nautilus, the share is shown in the sidebar under "Computer", and clicking on this takes me to the correct folder, but again, its empty.
Any ideas as to what I'm doing wrong?
© Ask Ubuntu or respective owner