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.

3
  • How about the permissions of files inside /data? Commented May 15, 2016 at 4:19
  • first of all, are you copying whole folder /data ? Commented May 15, 2016 at 5:18
  • no, jsut some specific files in /data/somedir. but all these folders have r+x permissions. Commented May 15, 2016 at 12:36

1 Answer 1

1

mount with option allow_other.

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

1
  • default_permissions saved me. Commented May 17, 2016 at 2:41

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.