Permissons to upload to directory and read directory


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.
Who is Participating?
others has rx permission to a dir does mean they can read the files inside the dir!

the file permisions must be readable for others as well.

if the dir is for the webserver, and you want to allow the users can read the file in the shell (telnet, ssh login etc). the file permsions need to be:

755 (for scripts)

assume that you set:
assume that out owned by fred and belong to nobody group
chmod 755 output
chmod g+s

in your php script, you need to set umask to 022 before upload the file to make
sure all the files are readable to the others.

If you want to use ACL, please have a look at the links (tutorial in):



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
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

use the command

chmod 744 output

your problem will be solved
rossh1977Author Commented:
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?


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.

EE Cleanup Volunteer
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.