1

My application on the server wants to copy a file from a remote directory mounted by sshfs to a local directory. The application code:

shutil.copy('/data/somdir/somefile.txt','/var/www/App/localfolder' )

The permissions of /data is as follows:

drwxrwxrwx   1   1027 root  4096 May  6 10:16 data

So every user(including Apache) should able to access the folder, but in the logfile I get:

IOError: [Errno 13] Permission denied

Some edits and updates on my question:

I set allow_other when mounting via SSHFS, and all the directories along the path to the source file have permissions of at least 755.So any use has read access to it.

  • How about the permissions of files inside /data? – Julie Pelletier May 15 '16 at 4:19
  • first of all, are you copying whole folder /data ? – Rahul May 15 '16 at 5:18
  • no, jsut some specific files in /data/somedir. but all these folders have r+x permissions. – Alex May 15 '16 at 12:36
1

mount with option allow_other.

If you rely on these permissions being enforced, add the option default_permissions.

  • default_permissions saved me. – Alex May 17 '16 at 2:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.