Very n00b question

Discuss Networking

Very n00b question

Postby Refalm » Wed Apr 07, 2004 9:29 am

User problem. Someone made a shell account for me.

Now, I will be needing to edit some files. User f has permission to edit the dir /var/www/htdocs/site. Now, he wants to give the user refalm the same rights as user f. What is the command for such a thing?
Refalm
user
user
 
Posts: 36
Joined: Tue Jan 21, 2003 12:40 pm
Location: Nijmegen, The Netherlands

Postby Tux » Wed Apr 07, 2004 9:33 am

I'd say the easiest way would to be to make a group that has access to the directories and make refalm and f members of the group.
Tux
guru
guru
 
Posts: 689
Joined: Wed Jan 08, 2003 10:40 am

Postby Refalm » Wed Apr 07, 2004 10:02 am

is
Code: Select all
groupadd newgroup
usermod -g newgroup refalm
the right command?
Refalm
user
user
 
Posts: 36
Joined: Tue Jan 21, 2003 12:40 pm
Location: Nijmegen, The Netherlands

Postby Void Main » Wed Apr 07, 2004 10:42 am

To expand on what Tux said.. I assume that one of you have root access? You'll need that to create a group and add your userids to that group. Once you have a group that you are both in you can make sure that the directory and files/directories under that directory are assigned to that group:

# chgrp -R group /var/www/htdocs/site

Now you also have to make sure that the group can read/write to that directory:

# chmod g+rwx /var/www/htdocs/site

The above command only changes permission on the directory itself. You surely would not want to make all files executable but you would probably want to give read write access to the group on all files/directories under it:

# chmod -R g+rw /var/www/htdocs/site

The above will set the "group" permissions to at least read/write (if they also have execute permissions they will retain the execute permissions).

Of course any new file created by either of you will initially be created group owned by whatever your primary group is for your userid. In addition the permissions will be set based on what your current "umask" is set to (type "umask" to see what your umask value is). If your umask is "0002" then when you create a file it will have the proper permissions (rw-rw-r) but it's assigned group would be whatever your primary group is as I said. You could change the group using "chgrp group filename" or if youboth change your primary group to this new group you will not have to do that.

To add a group you just "groupadd groupname" but then you have to add users to the group. This can be done with the "usermod" command. These have to be run by root. To change your primary group you would use the "-g groupname" param to usermod. To just add the user to the group you would use the "-G groupname1,groupname2,etc":

http://voidmain.is-a-geek.net/man?param ... d&mode=man
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Refalm » Wed Apr 07, 2004 12:19 pm

Thanks Tux and Void Main.

I never knew this website had a man page, and a good one too! I'll use this more often :)
Refalm
user
user
 
Posts: 36
Joined: Tue Jan 21, 2003 12:40 pm
Location: Nijmegen, The Netherlands


Return to Networking

Who is online

Users browsing this forum: No registered users and 2 guests