LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   permissons rights (https://www.linuxquestions.org/questions/linux-newbie-8/permissons-rights-141308/)

tommytomato 02-02-2004 04:23 AM

permissons rights
 
Hi

I have white box, two pc running

added a new user to the system, trying to give my self access to write to /var/www/html using a FTP etc...

So what i did was

[root@www root]# chown -R user_name /var/www/html

[root@www html]# ls -al
total 8
drwxr-xr-x 2 User_name root 4096 Feb 2 18:12 .
drwxr-xr-x 8 root root 4096 Feb 3 2004 ..


I am able to write to the directory, make other folders etc.

I dont know if this is right.

can any one fill me in please.

TT

:study:

hw-tph 02-02-2004 05:29 AM

One solution is creating a group specifically for users who should be able to create files and directories in /var/www/html.

All commands below are to be executed as root.
1. Create the group: groupadd webbies
This will create a group called webbies. You can name it whatever you want but I find that having non-professional sounding names can help you remember what groups you have creaetd yourself and what ones came with the distribution. Not that it matters much though. :)

2. Change ownership of /var/www/html and subdirectories: chown -R root.webbies /var/www/html

3. Make sure the webbies group members have write access everywhere in /var/www/html: chmod -R g+rw /var/www/html/*

4. Finally, add yourself and anyone that should have write access there to the webbies group (or whatever you chose to call your group). Open up /etc/group and find the line that begins with webbies, like this:
Code:

webbies:x:407:
After the last colon you can add a comma-separated list of users:
Code:

webbies:x:407:tommy,hw,elvis
Users don't become members until they have logged in the next time (so log out and then log in again). Type groups to see a list of groups you are member of.


Håkan

tommytomato 02-02-2004 05:47 AM

Thank you.

thats the way i was going it before adding a new user then a group called gateway, i added my user to that group then i did the following but i was told it was wrong.
Quote:


chgrp –R gateway /path/to/gatewayfiles’

OR

chown –R root.gateway /path/to’
Then
Quote:

chmod –R g+rw /path/to

but hey it worked, any way is the above one i did ok to use like that .

TT:study:


All times are GMT -5. The time now is 05:41 AM.