Guy's
There is file in AIX called applog related to application and it's owned by root:system
I want normal user called appuser to mange this file without change the file owner and without add the appuser in root group
Is there any way to give this user appuser full Control in that file applog ?
---------- Post updated at 11:53 PM ---------- Previous update was at 05:55 AM ----------
is there any way to give full control for appuser (Normal user) on that file without change any thing in the owner or permission of the file .
you can add an ACL allowing that user full access, if AIX supports it. See chmod. I am not familiar with AIX so I googled it and found this is might help you out
I could not determine if you did not want to change group ownership either.
If you do not mind, you could change the group ownership from system to a group that the appuser is a member of and issue
chgrp somegroup applog
chmod g+w applog
If the user has read only rights on the parent directory he will not be able to delete the file but he will be able to modify its contents.
Well with my suggestions the user will be able to make the file 0 byte size and copy the file to an other directory. Your saying it "will not work", can you elaborate what you mean by that, or do you mean you simply do not want that for some reason?
Alternative would be to implement sudo to allw the commands you specify.
In order to let the user do what you wish he either needs to be the owner of the file or needs to be a member of the group that owns the file. If he isn't one of those then sudo is the simplest way of allowing what you want.
Unless you can tell us what will not work if you change the group ownership of the logfile as ITHelper suggested.
ACLs do not affect POSIX. The owner and group can stay the same and you can grant that user account full control of the file. Read the links I posted previously.
Enable ACL by editing acl of target_file :
acledit target_file (change from disable to enable)
Like so :
attributes: SUID
base permissions:
owner(root): rwx
group(system): r-x
others: ---
extended permissions:
enabled
permit rwx u:appuser
Hope it helped.
EDIT :
Set up FULL path of your favorite editor to environment variable EDITOR for editing with acledit.