Very n00b question

Discuss Networking
Post Reply
Refalm
user
user
Posts: 38
Joined: Tue Jan 21, 2003 12:40 pm
Location: Twente
Contact:

Very n00b question

Post by Refalm »

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?

Tux
guru
guru
Posts: 689
Joined: Wed Jan 08, 2003 10:40 am

Post by Tux »

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.

Refalm
user
user
Posts: 38
Joined: Tue Jan 21, 2003 12:40 pm
Location: Twente
Contact:

Post by Refalm »

is

Code: Select all

groupadd newgroup
usermod -g newgroup refalm
the right command?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main »

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

Refalm
user
user
Posts: 38
Joined: Tue Jan 21, 2003 12:40 pm
Location: Twente
Contact:

Post by Refalm »

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 :)

Post Reply