Operating System - HP-UX
1834789 Members
2986 Online
110070 Solutions
New Discussion

changing file permissions for user

 
N.D
Occasional Advisor

changing file permissions for user

Hi

I need to change permissions for user "user1".
The user needs to be able to delete files from a certain dir and its sub directories. Under these directories there are other users however all these users belong to same group
7 REPLIES 7
Mark Grant
Honored Contributor

Re: changing file permissions for user

You just need to make sure that all the directories and files that user1 needs to be able to delete have group rw permission and group x permission on directories.chmod g+rw file or chmod g+rwx directory
Never preceed any demonstration with anything more predictive than "watch this"
Suresh Patoria
Super Advisor

Re: changing file permissions for user

Hi,

Set the sticky bit on that directory using the chmod 1755 /directory

Thanx
Marco Santerre
Honored Contributor

Re: changing file permissions for user

Since they all belong to the same group, just make sure that all directories and subs have the w on the group, that way user1 will be able to delete files.
Cooperation is doing with a smile what you have to do anyhow.
T G Manikandan
Honored Contributor

Re: changing file permissions for user

Providing group rights would solve the problem.

But other users in the group would delete files of some other user in the same group.

you can do a
1757 on that directory.

i.e.trwxr-xrwx

You can also enable ACLS if you have the available JFS version of file system.


Revert
V. Nyga
Honored Contributor

Re: changing file permissions for user

Hi Missy,

dir and sub dirs must belong to the group of 'user1'.
For changing permissions of sub dirs add '-R':
chmod -R g+w dir
w for write (and delete).
read and execute are most times set - you should check it.
Changing group of dir and sub dirs:
chgrp -R 'group' dir

Regards
Volkmar
*** Say 'Thanks' with Kudos ***
V. Nyga
Honored Contributor

Re: changing file permissions for user

Hi Missy,

if you don't want other users to have the same permissions as 'user1' you also can give 'user1' a own (second) group and change the group of the dir and sub dirs to this group of 'user1'.
To give 'user1' permissions to this second group, use 'logingroup' in /etc.
See 'man logingroup'.
This is a link to /etc/group

Regards
Volkmar
*** Say 'Thanks' with Kudos ***
GK_5
Regular Advisor

Re: changing file permissions for user

If you do not want other users from the group to delete the files, you should use ACL.
man setacl for more details

GK
IT is great!