1

My django application (v1.8) is using a directory for exporting some csv files. This directory is something like: "/home/username/django_project/csv_out".

I have intentionally chmod the "csv_out" dir to 777.

My partner wanted to access this directory in order to download and inspect those csv files.

I created an FTP user like this:

useradd ftp_user -p somepassword -d /home/username/django_project/csv_out/ -s /bin/false

Since then I get a "Permission Denied" error from Django (was not getting that error before): The FTP Server is giving access to the folder without problem. Django "misbehaves".

IOError: [Errno 13] Permission denied: '/home/username/django_project/csv_out/weights_1.csv'

Am I doing something wrong?

PS: I am using proftpd ftp server

xpanta
  • 8,124
  • 15
  • 60
  • 104
  • Why FTP servers even bother to ask for a username and passwords is a real mystery. – e4c5 Jan 04 '17 at 14:47
  • Are you getting the "Permission denied" error when uploading files, or when downloading files? – Castaglia Jan 04 '17 at 16:01
  • I am getting the "Permission Denied" error, from Django when it tries to access the directory, not the ftp server. The FTP server works fine. It allows access to that directory. – xpanta Jan 05 '17 at 14:56

2 Answers2

0

You also need +x (search) permission on /home/username and /home/username/django_project/ directories for ftp_user

Try this

 chmod a+x /home/username
 chmod a+x /home/username/django_project/
Alex Vyushkov
  • 650
  • 1
  • 6
  • 21
  • Thanks, will try that today, and report back. – xpanta Jan 03 '17 at 08:58
  • I am sorry, it didn't work. Actually the problem is with django, not linux. Django is giving me the "permission denied" so, I need to do something with the django settings or proftpd configuration (somehow revoke access for this folder or something similar) – xpanta Jan 03 '17 at 20:50
0

note your ftp user is different from your website user.
which user account you started your django website?

Gary
  • 4,495
  • 13
  • 36
  • 49
  • You have a point. The owner of the directory "csv_out" is the user "soulman". It is the user that I use to log in to the system and work. I did not want to give this user's password to my partner and mess with things. So I tried to create another user to connect through ftp and have access only to this directory. There must be some conflict there as I see it. Is there any simple workaround for this? – xpanta Jan 04 '17 at 11:46