Solved

group and permissions in linux for apache

Posted on 2013-12-31
5
447 Views
Last Modified: 2014-01-16
Dear Experts:

We are having an CRM application still the development is in progress we would like to restrict the crm  developer with ftp access to the /var/www/html/sugar_1 hence created user account as sugar_1 and home directory is in /var/www/html/sugar_1 and shared the ftp login details also used vsftpd and jailed to home directory, now the application requires the user to be apache and also read , write and execute permission whenever the developer uploads developed code then it is being uploaded as ftp login user name

Please suggest how to handle this, how to add apache user become user/owner for the files uploaded by the ftp user.

Please suggest thanks in advance
0
Comment
Question by:D_wathi
5 Comments
 
LVL 23

Expert Comment

by:savone
ID: 39749070
The following will make your developer the owner of the files, and give the user group apache (which apache server usually belongs) read, write and execute permissions.  This will also allow read and execute permissions for everyone else (usually needed for a website).


chown suger_1:apache /var/www/html/sugar_1
chmod -R 775 /var/www/html/sugar_1
0
 

Author Comment

by:D_wathi
ID: 39749737
Thank you very much for the reply, we also have done sugarcrm integration with asterisk if ftp user and apache is only set with 775 than asterisk in crm is not working but if we set 777 i mean rwx for others it is working,  

I think asterisk should also be the owner for this sugar_1 directory, please suggest how to make asterisk also owner for the directoy sugar_1 in addition to the sugar_1 and apache,

Thanks in advance.
0
 
LVL 23

Expert Comment

by:savone
ID: 39749822
You can't make two people the owner of any file or directory.  You can however add asterisk to the apache group with the permissions I gave you earlier.

Better yet, make an entirely new group and add apache and asterisk to it and give that group permissions to the sugar_1 directory.
0
 
LVL 61

Assisted Solution

by:gheist
gheist earned 250 total points
ID: 39750413
You need to add apache to default group of that user (say put all those uploading users in group "uploaders" and make their chroot directories g+s "uploaders and all the files will be read by apache)

Can you elaborate on what apache will execute?
0
 
LVL 13

Accepted Solution

by:
Sandy earned 250 total points
ID: 39761780
Just to add here... Why don't you use "acl" parameter of filesystem which will allows you to add multiple users as user/group owner of single directory each with own set of permissions.

#setfacl -m u:user:rwx /directory_to_be_used

#getfacl /directory_to_be_used

To apply it first you need to enable to FS with acl option.

TY/SA
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now