Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Is there a way to restrict a user (owner) to execute scripts from a specific directory Post 303040208 by Peasant on Thursday 24th of October 2019 11:51:06 PM
Old 10-25-2019
How about mounting the NFS share read-only / noexec no the reference server ?
User will still be able to execute the script in that directory/mountpoint using bash script.sh
Read only would stop write on that same filesystem if that would help.

Even if you do all possible magic, a shell access and permissions would still allow user Bob to copy / change / execute the shell code on server1.

Actually, i cannot think of a way to stop user Bob of being Bob in your use case, no matter which server is in question.
Perhaps someone else here has some bright idea Smilie

Hope that helps
Regards
Peasant.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

CRON job to execute all scripts in a directory

Hi everyone: I'm trying to make a CRON job that will execute Fridays at 7am. I have the following: * 7 * * 5 I've been studying up on CRON and I know to have this in a file and then "crontab filename.txt" to add it to the CRON job list. The CRON part I believe I understand, but I would... (6 Replies)
Discussion started by: Annorax
6 Replies

2. Shell Programming and Scripting

How to restrict the number of commands user can execute

Hi all, Is there a way to prevent users from being able to execute commands less a select few? For instance, I wish to allow the user to be only able to execute 1 command, which is exec a.sh. He should not be able to do simple stuff such as ls, cd, rm, cat, etc. Can this be achieved? ... (1 Reply)
Discussion started by: rockysfr
1 Replies

3. UNIX for Advanced & Expert Users

Restrict FTP access to a single directory for only one user.

Hi All, It will be very great if you can help me in this issue. Thanks in advance. I need to enable FTP on a solaris9 server. I need to create a new user some "xxxxxx" and he can only FTP the files to and from between /tftpboot directory and network devices. Other users should not... (8 Replies)
Discussion started by: santhoshkumar_d
8 Replies

4. UNIX for Dummies Questions & Answers

how do U restrict a user to a single directory?

specifically - I don't need to restrict a user to a single directory - but I want them to be "ROOTED" to their home directory. so if my home directory is /home/onlyme when I login - if I do a pwd - I want to see: / but in real life I will be in /home/onlyme - it just appears as root to... (10 Replies)
Discussion started by: itobenon
10 Replies

5. UNIX for Dummies Questions & Answers

restrict one user to see only his home directory in his profile

Hi I need to restrict one user to see only his home directory and one more directory how i can do this in his profile. The OS is Red hat linux I create a user -- tec and group calle --tec one the user log in he will see /home/tec and he need to see /opt/load this dirctory... (6 Replies)
Discussion started by: aboorkuma
6 Replies

6. Linux

Restrict User to only execute the file.

Hi Gurus , I hope you are doing great . Other than owner of the file , OTHERS and GROUP should be restricted from read or write a file created by the owner. OTHERS and GROUP should be only allowed to execute the file. Thanks in advance. (8 Replies)
Discussion started by: palanisvr
8 Replies

7. Red Hat

Restrict user to a particular directory

Hi I have a Fedora10 server and i need a particular user to view files only in a particular folder. All other files in other folders having "read" permission for all shouldn't be accessible to this user. Please let me know if ther's a way. Thanks, HG (5 Replies)
Discussion started by: Hari_Ganesh
5 Replies

8. Solaris

Restrict FTP User to a Directory

I am using Solaris 10 on SPARC. SunOS ddw 5.10 Generic_139555-08 sun4u sparc SUNW,SPARC-Enterprise I have put some text files in a directory '/u01/network' I want to create a ftp user which can just read the files in the network directory. The ftp user shouldn't be able to navigate or see... (4 Replies)
Discussion started by: fahdmirza
4 Replies

9. Solaris

How to restrict user to a specific directory in solaris 10

Hi all, I want to create a new user and grant him ONLY transfer files access to a specific directory where he can only upload and read the files. He should be restricted to this activity only. Regards (6 Replies)
Discussion started by: gilldn
6 Replies

10. AIX

How to restrict user to a particular directory?

hi, I want to restrict some user access to only 1 directory (including all sub-directories/files in it). can you please explain me, how can we do this? example; Filesystem GB blocks Used Free %Used Mounted on /dev/hd4 2.61 1.02 1.59 40% / /dev/hd2 ... (7 Replies)
Discussion started by: aaron8667
7 Replies
AUTO_MASTER(5)						      BSD File Formats Manual						    AUTO_MASTER(5)

NAME
auto_master -- auto_master and map file format DESCRIPTION
The automounter configuration consists of the auto_master configuration file, which assigns filesystem paths to map names, and maps, which contain actual mount information. The auto_master configuration file is used by the automount(8) command. Map files are read by the automountd(8) daemon. AUTO_MASTER SYNTAX The auto_master file consists of lines with two or three entries separated by whitespace and terminated by newline character: mountpoint map_name [-options] mountpoint is either a fully specified path, or /-. When mountpoint is a full path, map_name must reference an indirect map. Otherwise, map_name must reference a direct map. See MAP SYNTAX below. map_name specifies map to use. If map_name begins with -, it specifies a special map. See MAP SYNTAX below. If map_name is not a fully specified path (it does not start with /), automountd(8) will search for that name in /etc. Otherwise it will use the path as given. If the file indicated by map_name is executable, automountd(8) will assume it is an executable map. See MAP SYNTAX below. Otherwise, the file is opened and the contents parsed. -options is an optional field that starts with - and can contain generic filesystem mount options. The following example specifies that the /etc/auto_example indirect map will be mounted on /example. /example auto_example MAP SYNTAX
Map files consist of lines with a number of entries separated by whitespace and terminated by newline character: key [-options] [mountpoint [-options]] location [...] In most cases, it can be simplified to: key [-options] location key is the path component used by automountd(8) to find the right map entry to use. It is also used to form the final mountpoint. A wild- card ('*') can be used for the key. It matches every directory that does not match other keys. Those directories will not be visible to the user until accessed. The options field, if present, must begin with -. When mounting the filesystem, options supplied to auto_master and options specified in the map entry are concatenated together. The special option fstype is used to specify filesystem type. It is not passed to the mount program as an option. Instead, it is passed as an argument to mount -t. The default fstype is 'nfs'. The special option nobrowse is used to disable creation of top-level directories for special and executable maps. The optional mountpoint field is used to specify multiple mount points for a single key. The location field specifies the filesystem to be mounted. Ampersands ('&') in the location field are replaced with the value of key. This is typically used with wildcards, like: * 192.168.1.1:/share/& The location field may contain references to variables, like: sys 192.168.1.1:/sys/${OSNAME} Defined variables are: ARCH Expands to the output of uname -p. CPU Same as ARCH. HOST Expands to the output of uname -n. OSNAME Expands to the output of uname -s. OSREL Expands to the output of uname -r. OSVERS Expands to the output of uname -v. Additional variables can be defined with the -D option of automount(8) and automountd(8). To pass a location that begins with /, prefix it with a colon. For example, :/dev/cd0. This example, when put into /etc/auto_example, and with auto_master referring to the map as described above, specifies that the NFS share 192.168.1.1:/share/example/x will be mounted on /example/x/ when any process attempts to access that mountpoint, with intr and nfsv4 mount options, described in mount_nfs(8): x -intr,nfsv4 192.168.1.1:/share/example/x Automatically mount an SMB share on access, as a guest user, without prompting for a password: share -fstype=smbfs,-N ://@server/share Automatically mount the CD drive on access: cd -fstype=cd9660 :/dev/cd0 SPECIAL MAPS
Special maps have names beginning with -. Supported special maps are: -hosts Query the remote NFS server and map exported shares. This map is traditionally mounted on /net. Access to files on a remote NFS server is provided through the /net/nfs-server-ip/share-name Ns/ directory without any additional configuration. Directories for individual NFS servers are not present until the first access, when they are automatically created. -media Query devices that are not yet mounted, but contain valid filesystems. Generally used to access files on removable media. -null Prevent automountd(8) from mounting anything on the mountpoint. It is possible to add custom special maps by adding them, as executable maps named special_foo, to the /etc/autofs/ directory. EXECUTABLE MAPS
If the map file specified in auto_master has the execute bit set, automountd(8) will execute it and parse the standard output instead of parsing the file contents. When called without command line arguments, the executable is expected to output a list of available map keys separated by newline characters. Otherwise, the executable will be called with a key name as a command line argument. Output from the exe- cutable is expected to be the entry for that key, not including the key itself. INDIRECT VERSUS DIRECT MAPS
Indirect maps are referred to in auto_master by entries with a fully qualified path as a mount point, and must contain only relative paths as keys. Direct maps are referred to in auto_master by entries with /- as the mountpoint, and must contain only fully qualified paths as keys. For indirect maps, the final mount point is determined by concatenating the auto_master mountpoint with the map entry key and optional map entry mountpoint. For direct maps, the final mount point is determined by concatenating the map entry key with the optional map entry mount- point. The example above could be rewritten using direct map, by placing this in auto_master: /- auto_example and this in /etc/auto_example map file: /example/x -intr,nfsv4 192.168.1.1:/share/example/x /example/share -fstype=smbfs,-N ://@server/share /example/cd -fstype=cd9660 :/dev/cd0 DIRECTORY SERVICES
Both auto_master and maps may contain entries consisting of a plus sign and map name: +auto_master Those entries cause automountd(8) daemon to retrieve the named map from directory services (like LDAP) and include it where the entry was. If the file containing the map referenced in auto_master is not found, the map will be retrieved from directory services instead. To retrieve entries from directory services, automountd(8) daemon runs /etc/autofs/include, which is usually a shell script, with map name as the only command line parameter. The script should output entries formatted according to auto_master or automounter map syntax to standard output. An example script to use LDAP is included in /etc/autofs/include_ldap. It can be symlinked to /etc/autofs/include. FILES
/etc/auto_master The default location of the auto_master file. /etc/autofs/ Directory containing shell scripts to implement special maps and directory services. SEE ALSO
autofs(5), automount(8), automountd(8), autounmountd(8) AUTHORS
The auto_master configuration file functionality was developed by Edward Tomasz Napierala <trasz@FreeBSD.org> under sponsorship from the FreeBSD Foundation. BSD
January 9, 2015 BSD
All times are GMT -4. The time now is 02:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy