Autofs to map windows share

If none of the more specific forums is the right place to ask

Autofs to map windows share

Postby sege5641 » 2017-08-12 02:07

I have been having trouble with my network so my standard way of mapping shares isn't working. I have changed to autofs and believe its all setup correctly but the mapped share has root permissions and I can't access anything in it. I could use some help to figure out what isn't working here.

/etc/auto.master
Code: Select all
#
# Sample auto.master file
# This is a 'master' automounter map and it has the following format:
# mount-point [map-type[,format]:]map [options]
# For details of the format look at auto.master(5).
#
#/misc  /etc/auto.misc
#
# NOTE: mounts done from a hosts map will be mounted with the
#       "nosuid" and "nodev" options unless the "suid" and "dev"
#       options are explicitly given.
#
#/net   -hosts
#
# Include /etc/auto.master.d/*.autofs
# The included files must conform to the format of this file.
#
+dir:/etc/auto.master.d
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
#+auto.master
/mnt/media /etc/auto.sky-vault --ghost


/etc/auto.sky-vault
media -fstype=cifs,rw,username=user,password=pass,file_mode=0777,dir_mode=0777 ://sky-vault/media
sege5641
 
Posts: 6
Joined: 2017-03-16 16:19

Re: Autofs to map windows share

Postby sege5641 » 2017-08-12 22:46

Does no one have any help they can give?
sege5641
 
Posts: 6
Joined: 2017-03-16 16:19

Re: Autofs to map windows share

Postby wizard10000 » 2017-08-13 13:29

sege5641 wrote:Does no one have any help they can give?


Instead of using dir_mode and file_mode perhaps the thing to do would be specify UID and GID -
Code: Select all
uid=myuserid,gid=mygrpid
we see things not as they are, but as we are.
-- anais nin
User avatar
wizard10000
 
Posts: 1224
Joined: 2011-05-09 20:02
Location: everywhere i go, there i am!

Re: Autofs to map windows share

Postby sege5641 » 2017-08-13 14:13

wizard10000 wrote:
sege5641 wrote:Does no one have any help they can give?


Instead of using dir_mode and file_mode perhaps the thing to do would be specify UID and GID -
Code: Select all
uid=myuserid,gid=mygrpid


I tried that in the past and give it another go just now. The share isn't showing up at all now. When I stop and start the service with
sudo automont -f -v

everything shows ok no errors.
sege5641
 
Posts: 6
Joined: 2017-03-16 16:19

Re: Autofs to map windows share

Postby nixer » 2017-08-13 18:46

I do not know if this will help or not, but it may be worth a try. Instead of using this,
media -fstype=cifs,rw,username=user,password=pass,file_mode=0777,dir_mode=0777 ://sky-vault/media


Try this,
media -fstype=cifs,rw,credentials=/home/USER/secret.txt,file_mode=0777,dir_mode=0777 ://sky-vault/media

And then put this in the "secret.txt" file and place this file in the location stated above:
username=your-username
password=your-password


I had this problem some time back and this is the only way I could get it to work.

Also, one more thing to try, Instead of using the computer name in the code above, have you tried to use the computer ip address instead? In other words,
media -fstype=cifs,rw,credentials=/home/USER/secret.txt,file_mode=0777,dir_mode=0777 ://192.168.1.xxx/media
nixer
 
Posts: 56
Joined: 2013-12-01 17:09

Re: Autofs to map windows share

Postby sege5641 » 2017-08-20 15:20

nixer wrote:I do not know if this will help or not, but it may be worth a try. Instead of using this,
media -fstype=cifs,rw,username=user,password=pass,file_mode=0777,dir_mode=0777 ://sky-vault/media


Try this,
media -fstype=cifs,rw,credentials=/home/USER/secret.txt,file_mode=0777,dir_mode=0777 ://sky-vault/media

And then put this in the "secret.txt" file and place this file in the location stated above:
username=your-username
password=your-password


I had this problem some time back and this is the only way I could get it to work.

Also, one more thing to try, Instead of using the computer name in the code above, have you tried to use the computer ip address instead? In other words,
media -fstype=cifs,rw,credentials=/home/USER/secret.txt,file_mode=0777,dir_mode=0777 ://192.168.1.xxx/media



Golden! The issue was some where I was told to use /media in the front of the string but your steps removed the / and its mounting! Now I need to test a network disconnect to see if it will reconnect on its own.
sege5641
 
Posts: 6
Joined: 2017-03-16 16:19


Return to General Questions

Who is online

Users browsing this forum: kopper and 1 guest

fashionable