Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Autofs to map windows share

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
sege5641
Posts: 6
Joined: 2017-03-16 16:19

Autofs to map windows share

#1 Post by sege5641 »

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

#2 Post by sege5641 »

Does no one have any help they can give?

sege5641
Posts: 6
Joined: 2017-03-16 16:19

Re: Autofs to map windows share

#3 Post by sege5641 »

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.

nixer
Posts: 70
Joined: 2013-12-01 17:09
Has thanked: 1 time
Been thanked: 3 times

Re: Autofs to map windows share

#4 Post by nixer »

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

sege5641
Posts: 6
Joined: 2017-03-16 16:19

Re: Autofs to map windows share

#5 Post by sege5641 »

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.

Post Reply