Results 1 to 7 of 7

Thread: Adding an existing user to a group isn't working as advertized

  1. #1
    Join Date
    May 2012
    Beans
    16

    Adding an existing user to a group isn't working as advertized

    I do not know if I was misinformed, but it does not have the exected result.

    I was told that in order for a developer to have read/write access to /var/www the user had to be added to the www-data group.

    I have already successfully enabled the user to log in using ssh. When I log in as that user using ssh, I can change to /var/www, and I can read the only file there (index.html). However, I can not edit it.

    I added the user to www-data using the following:

    usermod -a -G www-data theuser

    When I do so, I can see in the group file that the user name has been added to the end of the www-data record. But nothing else seems to have changed. The user still can not edit anything in /var/www.

    What did I miss?

    Thanks

    Ted

  2. #2
    Join Date
    Apr 2012
    Beans
    5,340

    Re: Adding an existing user to a group isn't working as advertized

    iirc the change won't take effect until the /etc/passwd file is re-read - typically that's when the user logs out and back in but I believe the user can now force a reload in the current login environment by executing

    Code:
    newgrp -

  3. #3
    Join Date
    Feb 2011
    Location
    Coquitlam, B.C. Canada
    Beans
    1,424
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Adding an existing user to a group isn't working as advertized

    Has /var/www had the write permission for www-data added?
    see: https://help.ubuntu.com/12.04/server...ry-permissions

    which basically says do this:
    Code:
    sudo chgrp -R www-data /var/www
    sudo find /var/www -type d -exec chmod g=rwxs "{}" \;
    sudo find /var/www -type f -exec chmod g=rws "{}" \;

  4. #4
    Join Date
    May 2012
    Beans
    16

    Re: Adding an existing user to a group isn't working as advertized

    Quote Originally Posted by steeldriver View Post
    iirc the change won't take effect until the /etc/passwd file is re-read - typically that's when the user logs out and back in but I believe the user can now force a reload in the current login environment by executing

    Code:
    newgrp -
    Thank you for your reply.

    Alas, that isn't the issue here as I had logged in and out as that user several times (that thought had occured to me), but doing so didn't change anything

    Thanks again

    Ted

  5. #5
    Join Date
    May 2012
    Beans
    16

    Re: Adding an existing user to a group isn't working as advertized

    Quote Originally Posted by Doug S View Post
    Has /var/www had the write permission for www-data added?
    see: https://help.ubuntu.com/12.04/server...ry-permissions

    which basically says do this:
    Code:
    sudo chgrp -R www-data /var/www
    sudo find /var/www -type d -exec chmod g=rwxs "{}" \;
    sudo find /var/www -type f -exec chmod g=rws "{}" \;
    Thank you for your reply. That was what I missed.

    But, I suppose I need to apply the same three commands to /usr/lib/cgi-bin, right?

    Thanks

    Ted

  6. #6
    Join Date
    Feb 2011
    Location
    Coquitlam, B.C. Canada
    Beans
    1,424
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Adding an existing user to a group isn't working as advertized

    Not exactly, as in the cgi-bin directory you would want the files to be executable.

  7. #7
    Join Date
    May 2012
    Beans
    16

    Re: Adding an existing user to a group isn't working as advertized

    Quote Originally Posted by Doug S View Post
    Not exactly, as in the cgi-bin directory you would want the files to be executable.
    So that means
    Code:
    find /usr/lib/cgi-bin -type f -exec chmod g=rws "{}" \;
    becomes
    Code:
    find /usr/lib/cgi-bin -type f -exec chmod g=rwxs "{}" \;
    right?

    Thanks

    Ted

Tags for this Thread

Bookmarks

Posting Permissions

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