Link to home
Start Free TrialLog in
Avatar of rossh1977
rossh1977

asked on

Permissons to upload to directory and read directory

Hi,

I'm having a problem setting permission for a directory using Unix, telnet.  I want to upload using a php script to a directory.  I then want to allow the user to browse this directory so i need to have the permission to read it.

Could someone give me the instructions for this.  Sof far i've been using:-

chmod o-rx output
setfacl -m user:nobody:-wx output
chmod g+w output

But it's not worked.
Avatar of siliconbrit
siliconbrit


Since the apache process likely runs under the nobody user, and this will not be in the same user group as your home user, you will need to give world read and write rights to access the directory.  I cant be sure of this, since I dont know how your server is configured, or what users/groups are in play, so here's a strategy to find the correct permissioning model.

Start with some slack permissions such as:

   chmod 777 output

Then use the following commands in order, to find the tightest permission set that works for your server configuration:

   chmod 776 output
   chmod 766 output
   chmod 744 output
   chmod 744 output

When you find one setting that will not allow either your upload or your browsing, revert to that last one that worked.

Note - Don't bother with 'setfacl' unless you know exactly what you are doing, and remove any setfacl settings you have already created.

sorry - typo:

   chmod 776 output
   chmod 766 output
   chmod 764 output              <-  corrected
   chmod 744 output
ASKER CERTIFIED SOLUTION
Avatar of yuzh
yuzh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
use the command

chmod 744 output

your problem will be solved
Avatar of rossh1977

ASKER

Hi tried all your suggestion but none seem to do what i'm after.  I think this is a unix solaris system im connecting to via telnet.  yuzh i tried your suggestions but i'm stuck on the umask part can you explain a bit more?

Thanks

Ross
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept yuzh #16276683

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

gheist
EE Cleanup Volunteer