I suggest staying away from ACLs. They tend to create bigger problems than they solve, but that is just my opinion.
Having said this: create a special group, give ownership of the file to this group, set the group rights to what you need and add the user you want to give access to the file to this group. This should achieve what you want.
Example:
Code:
file: /this/is/myfile owned by user:group
user to give access to: otheruser
# ls -l /this/is/myfile
-rwxr----- 1 user group 174080 Jun 15 12:14 /this/is/myfile
# mkgroup users=user,otheruser fileacc
# chown user:fileacc /this/is/myfile
# chmod 760 /this/is/myfile
# ls -l /this/is/myfile
-rwxrw---- 1 user fileacc 174080 Jun 15 12:14 /this/is/myfile
This will give the ID "otheruser" read- and write-access to the file while changing nothing for UID "user". Set the filemode "740" for read-access only.
I'm a newbie to Unix and hoping that it will be my saviour when all else has failed.
My "keys out of order" on my g4 laptop and neither Disk Util nor Disk Warrior can fix it.
I'm experimenting in the unix command line (I figure I can't mess this laptop up anymore , and have figured out how... (3 Replies)
Hi All,
How can i give permission for a specific user ( eg. admin ) ?
I tried with chmod admin+r prog.sh
which doesnt work.
Is there any way i can specify a user's name and give the permission?
Thanks in advance.
Saneesh Joseph. (1 Reply)
hi everyone.
iīve been burning my head for a week now with this problem and i couldnīt find a solution. iīve been looking for an answer in this forum but nothing either. so i decided to ask.
the thing is, i want to create a users with permission to kill just a group of users. i know how to write... (6 Replies)
Hi all,
I created testuser. by following command.
/usr/sbin/adduser -n test -d /disk05/collections/GET/testdata/
and then set its password by following command.
passwd testuser
When I login to system by testuser, it enters everything is ok.
The problem is how to set permission to this... (3 Replies)
Hi,
/etc/passwd file has write permission only for the root user.
Now when a normal user changes the its own password using passwd command, how this information has been written to the /etc/passwd file when the user is not having write permission to this file.
~santosh (2 Replies)
hello,
I would like to grant full access to a directory which is owned by root and the web application that created it. I have though of adding the permission to the whole world, but for security reason I would like to grant it to one more user.
I have tried this 'chmod -U newUser+wrx... (2 Replies)
Guy's
we are in AIX 5.3
We have created two users user1 and user2 and they are under same group Staff Group
user1 will create file under /tmp/ and this is the permission of this file
-rw-r--r-- 1 user1 staff 1 Jun 13 09:47 file
user2 is under same group and when he... (14 Replies)
Hi,
I'm newbie to unix.
There is a directory, say Testing/ under /home/user1.
I have created a user by the name check.
I was looking for a way to give the above user read & execute access only to this directory Testing/ while for other remaining files,directories,etc this user... (2 Replies)
Hi folks,
I am trying to grant the access like below items using the setfacl command, but i couldn't achieve as what I required. any other possibility.
username : testing
Readonly access in /form_dl/system/prd/logs
Write only access in /form_dl/system/prd/deploy
No access to other... (0 Replies)
Hi,
There are 2 users (T886072 & T864764) that need to be provided full (rwx) access to a directory. I made the changes to the directory permissions using chmod and setfacl :
root@digidb2:# chmod 700 /u02/ftpfiles/MFRS16/discount_rates/
root@digidb2:# setfacl -s... (3 Replies)
Discussion started by: anaigini45
3 Replies
LEARN ABOUT FREEBSD
acl_add_perm
ACL_ADD_PERM(3) BSD Library Functions Manual ACL_ADD_PERM(3)NAME
acl_add_perm -- add permissions to a permission set
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <sys/types.h>
#include <sys/acl.h>
int
acl_add_perm(acl_permset_t permset_d, acl_perm_t perm);
DESCRIPTION
The acl_add_perm() function is a POSIX.1e call that adds the permission contained in perm to the permission set permset_d.
Note: it is not considered an error to attempt to add permissions that already exist in the permission set.
For POSIX.1e ACLs, valid values are:
ACL_EXECUTE Execute permission
ACL_WRITE Write permission
ACL_READ Read permission
For NFSv4 ACLs, valid values are:
ACL_READ_DATA Read permission
ACL_LIST_DIRECTORY Same as ACL_READ_DATA
ACL_WRITE_DATA Write permission, or permission to create files
ACL_ADD_FILE Same as ACL_READ_DATA
ACL_APPEND_DATA Permission to create directories. Ignored for files
ACL_ADD_SUBDIRECTORY Same as ACL_APPEND_DATA
ACL_READ_NAMED_ATTRS Ignored
ACL_WRITE_NAMED_ATTRS Ignored
ACL_EXECUTE Execute permission
ACL_DELETE_CHILD Permission to delete files and subdirectories
ACL_READ_ATTRIBUTES Permission to read basic attributes
ACL_WRITE_ATTRIBUTES Permission to change basic attributes
ACL_DELETE Permission to delete the object this ACL is placed on
ACL_READ_ACL Permission to read ACL
ACL_WRITE_ACL Permission to change the ACL and file mode
ACL_SYNCHRONIZE Ignored
Calling acl_add_perm() with perm equal to ACL_WRITE or ACL_READ brands the ACL as POSIX. Calling it with ACL_READ_DATA, ACL_LIST_DIRECTORY,
ACL_WRITE_DATA, ACL_ADD_FILE, ACL_APPEND_DATA, ACL_ADD_SUBDIRECTORY, ACL_READ_NAMED_ATTRS, ACL_WRITE_NAMED_ATTRS, ACL_DELETE_CHILD,
ACL_READ_ATTRIBUTES, ACL_WRITE_ATTRIBUTES, ACL_DELETE, ACL_READ_ACL, ACL_WRITE_ACL or ACL_SYNCHRONIZE brands the ACL as NFSv4.
RETURN VALUES
The acl_add_perm() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to
indicate the error.
ERRORS
The acl_add_perm() function fails if:
[EINVAL] Argument permset_d is not a valid descriptor for a permission set within an ACL entry. Argument perm does not contain a
valid acl_perm_t value. ACL is already branded differently.
SEE ALSO acl(3), acl_clear_perms(3), acl_delete_perm(3), acl_get_brand_np(3), acl_get_permset(3), acl_set_permset(3), posix1e(3)STANDARDS
POSIX.1e is described in IEEE POSIX.1e draft 17.
HISTORY
POSIX.1e support was introduced in FreeBSD 4.0. The acl_add_perm() function was added in FreeBSD 5.0.
AUTHORS
The acl_add_perm() function was written by Chris D. Faulhaber <jedgar@fxp.org>.
BSD June 25, 2009 BSD