Operating System - HP-UX
1833828 Members
2354 Online
110063 Solutions
New Discussion

Re: How to give write access to other users' directory to an user ?

 
Deepu Chakravarty
Regular Advisor

How to give write access to other users' directory to an user ?

I want to give write access of one user's directory to another user. The user then have right to write/copy any file to that users directory.
4 REPLIES 4
Karthik S S
Honored Contributor

Re: How to give write access to other users' directory to an user ?

Create a group by name common and add these two users as the members. To the directory for which you want to give common access to these users change the permissions as,

chgrp common dir_name
chmod 775 dir_name

Whenever the other user wants to write to this directory he/she has to switch to the group first using,

newgrp common

Or you can also use sudo to delicate permissions,

http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/sudo-1.6.7p5/

-Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
Sanjay Kumar Suri
Honored Contributor

Re: How to give write access to other users' directory to an user ?

Suppouse user1 is in the group1 and user2 in group2 and access to user1 directory to be given to user2 Then

1. #usermod -G group1 user2
2. #chmod 755 dir_name (directory of user1)
3. user2 can use newgrp to change the user and access the directory.

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Sanjay Kumar Suri
Honored Contributor

Re: How to give write access to other users' directory to an user ?

Suppose user1 is in the group1 and user2 in group2 and access to user1 directory to be given to user2 Then

1. #usermod -G group1 user2
2. #chmod 755 dir_name (directory of user1)
3. user2 can use newgrp to change the user and access the directory.

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Anil C. Sedha
Trusted Contributor

Re: How to give write access to other users' directory to an user ?

Do the following

in /etc/group file add the following subsituting usera & userb with your user's id.

sample::555:usera,userb

In the user's directory

/home/usera/test
if test is the directory you want to give permission on,

chown -R usera:sample /home/usera/test
chmod -R 774 /home/usera/test

this will enable userb to read,write & execute anything in usera's home directory.

Pls let us know if this helps.

Regards,
Anil
If you need to learn, now is the best opportunity