Results 1 to 4 of 4
  1. #1

    How to make different users interact on a server?


    I am looking for some specific information. Wonder if you guys can help me.

    I own a couple of dedicated boxes and want to do the following:

    Lets say I have 2 different accounts for 2 different domains. On one of these domains I have a automatic page builder script which builds static pages for my dynamic content. Now this script can also put content from certain categories on a different domain. However it needs write access to the place the content is supposed to be build.

    In short: Script is hosted at:
    and should be able to write to:
    However user1 doesn't have permissions to write to user2... how can I change that?

    I know it badly put, but I just can't seem to simplify it!
    Addl info:
    I have a WHM and complete access to the server as root.

  2. #2
    Join Date
    Aug 2002
    Superior, CO, USA
    I think that this is a little dangerous, but the simplest way would be to place them both in the same Unix group and then set the directory permissions correctly. For example, add user1 and user2 to a new group, say group1. Then, make sure all of the directories that require cross writing are 770 and the files are 660 - that is, do something like:

    cd /home/user2/www/
    chmod 770 dir
    chgrp group1 dir
    cd dir
    find . -type d -exec chmod 770 {} \;
    find . -type f -exec chmod 660 {} \;
    find . -exec chgrp group1 {} \;

    Now when the users login they will be in multiple groups - including group1. That will allow both of them to write to /home/user2/www/dir. You may have to also change /home/user2 and/or /home/user2/www to at least allow the group to read, i.e. chmod 750 /home/user2 /home/user2/www.

  3. #3
    Thanks Stdunbar!
    But I'm afraid it is quite greek to me!
    How do I add different users to the same group?
    I remember seeing someplace (I just can't remember where, httpd.conf maybe?) where there was a line for allowing different users to access each others content. But I just can't seem to find it.
    Security is not so much a issue as I only host my own sites on the box. Just that I added each domain under a different user.

  4. #4
    Join Date
    Aug 2002
    Superior, CO, USA
    Sorry for the "geek greek". You say that you have full access to the server as root. I take that to mean that you can use an ssh client such as PuTTY (I'm guessing you're on a Windows machine), login to your machine and become root. If that is correct then read on. Otherwise you're in the world of control panels which is not something I'm familar with.

    Once you have logged into your machine and become root (do an "su -" (no quotes) to become root), start by doing a:

    groupadd groupname
    You can have the groupname above be whatever you want but traditionally you keep it to 8 characters or less. So lets say you created a group named "shared". Now comes the fun part. You will need to modify the file /etc/group. This will involve using a text editor or it may be possible via WHM (again, I have zero familarity with control panels). If you have to do the text editor route, here is what you do. You must be root to do this. You will be using a text editor named "vi". So, do:

    vi /etc/group

    You will see a screenfull of entries something like:

    and, potentially, many more.

    Now, type "/shared" (no quotes and no spaces). This is the search feature in vi. You are looking for the group you added with the groupadd command. On what is likely the last line you should see something like:

    (the number is very likely to be different). Next, type a capital A. This will append to the line. Type the first user name (that is, their login name like user1, not Bob User), a comma, and the second user name. Your line should now look something like:

    Next, press the escape key, then ":wq" (that is a colon character and then the w and q keys - no quotes).

    If you mess up, don't panic. Press the escape key and then ":q!" and start over.

    Now, again as root, execute the commands from my first post. Obviously replace user1 and user2 as needed and replace "group1" from my post with "shared" or whatever you called your group.

    The users will have to log out and back in before this will take effect.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts