Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


linux permissions
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

linux permissions

xaitmixaitmi Member
edited April 2016 in Help

Hi.

This is the contents of

**var --> www --> html
**
(I had to use --> because cloudflare kept blocking me from posting if i used / )

drwxrwxr-x 4 apache apache   4096 Apr 12 15:41 .

drwxr-xr-x 6 root   root     4096 Mar 22 15:04 ..

drwxrwxr-x 2 apache apache   4096 Apr 12 15:05 configs

-rw-r--r-- 1 apache apache  11916 Apr 12 15:41 configs.zip

-rw-rw-r-- 1 apache apache      6 Apr 11 20:09 index.php

drwxrwxr-x 2 apache apache   4096 Apr 12 15:41 tools

I have a user, let's call it george.

George's home directory is

var --> www --> html--> configs

I need george to be able to write files to his home directory.

How can I make sure that both george and apache have write permissions to that directory?

finger george
Login: george                   Name: 
Directory: var-->www-->html-->configs-->    Shell: -->bin-->bash

Comments

  • exception0x876exception0x876 Member, Host Rep, LIR
    edited April 2016

    Add user george to group apache

    gpasswd -a george apache

    Or you can add another group called 'config_write', then do

    chown apache:config_write your_directory

    and add both apache and george to config_write group

    Thanked by 1xaitmi
  • @exception0x876 said:
    Add user george to group apache

    gpasswd -a george apache

    gpasswd did the trick Thanks!

  • FalzoFalzo Member
    edited April 2016

    @xaitmi said:
    @exception0x876 said:

    the second way should be the only one choosen, because you would not want george to be able to read and maybe write everything that apache (group) is allowed to, would you?

  • exception0x876exception0x876 Member, Host Rep, LIR

    @Falzo said:
    the second way should be the only one choosen, because you would not want george to be able to read and maybe write everything that apache (group) is allowed to, would you?

    I wouldn't, but maybe @xaitmi would.

  • seanhoseanho Member
    edited April 2016

    You could also apply user/group permissions: e.g., make configs owned (and writable) by george but writable by the apache group:

    chown -R george.apache configs
    chmod -R g+rwx configs
    

    Something like that. I'm not sure it's a good idea to put george's home directory under var-www; better just to make the config directory accessible to him.

Sign In or Register to comment.