1828933 Members
2353 Online
109986 Solutions
New Discussion

Assign right permission

 
SOLVED
Go to solution
NiCK_76
Respected Contributor

Assign right permission

hi,

OS:redhat linux
I want to assign permission to a user whom can create and edit file in /home/www , can't delete and rename file in /home/www .

How can I assign permission ?
just for fun
6 REPLIES 6
Rahul Sharma_2
New Member

Re: Assign right permission

As root you can run a script to set the permission of every file created in /home/www to be set with the append only immutable bit:

# chattr +a /home/www/$filename

the /home/www dir should have rw permisissions for the user to create as many new files.



NiCK_76
Respected Contributor

Re: Assign right permission

I did to have a try

#useradd jack
#su - jack
$touch test
$exit
#chattr +a /home/jack/test
#su - jack
$vi jack

I can't edit the file that test.......
just for fun
Steven E. Protter
Exalted Contributor
Solution

Re: Assign right permission

Do a few things for me and I can solve this problem.

log on as jack

type the command id

post that output to this thread.

ll -d /home/www
or
ls -ad /home/www

post that output to this thread.

Need complete information to solve the problem.

I could also use id output on the user that currently owns the folder /home/www

Thanks.

SEP

Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
NiCK_76
Respected Contributor

Re: Assign right permission

hi,Steven E Protter
Thanks for your help

command output as following
id
uid=903(jack) gid=903(jack) groups=903(jack)

ll -d /home/www/
drwx------ 2 jack jack 4096 Nov 27 19:55 /home/www/
just for fun
Steven E. Protter
Exalted Contributor

Re: Assign right permission

Based on the information you have provided the permissions are correct.

jack owns the directory and the permissions are read write execute on the /home/www directory.

If you still can't write to it, I would suggest the following:

As root, remove the directory, if its not empty. If it is empty, rename it.

cd /home
mv www www.old
mkdir www
chown jack.jack www

Then try to write a file.

That should work.

Because You're new, I'd just like to point out the way we reward people for good answers and help is by point assignment. Please consider this for this and your other threads.

More the others than this.

http://forums1.itrc.hp.com/service/forums/pageList.do?userId=CA1198336&listType=unassigned&forumId=1

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
NiCK_76
Respected Contributor

Re: Assign right permission

thank you
just for fun