I have autofs working properly. I can mount a windows share on linux server without problems.But there is one issue: I don´t want that mounted share to be public to all linux users, just for a small group or a unique user. The auto.master file:
#
# 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 /etc/auto.cifs --timeout=60 --ghost
The auto.cifs file:
MountedPoint -fstype=cifs,username=JohnDoe,password=password,uid=108956,gid=540,forceuid,forcegid ://server.com/share$
Autofs is mounting the share$ at /mnt/MountedPoint but with the permissions dr-xr-xr-x 2 root root
. I tried chmod 700 but I got:chmod: changing permissions of ‘/mnt/MountedPoint/’: Permission denied
.Also tried chown userid:gid /mnt/MountedPoint/ and got the 'permission denied' message.
Is there any way to configure AutoFs to mount a windows share which can be accessed only by a specific user other than root?
I´m using Red Hat Enterprise Linux version 7.9
Thank you all !