1

I have recently bought a raspberry pi that I have installed as an Apache web server.

I do however have one problem: When I add files via ftp the permissions are set to -rw-------. There for I can not access the files without changing their permissions manually first, e.g chmod 755 /var/www -R (everytime I add a file or directory via ftp that is).

But this is of course not the correct way. What am I missing out?

Thanks in advance!

Edit: I am running vsftpd and Apache2 on a Debian "Wheezy", and followed this guide pretty much.

Edit #2: Requested umask settings from /etc/vsftpd.conf file:

# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
#local_umask=022

  • Server Fault is for Professional System Administrators only. Developer and Hobbyist questions are Off Topic. Please see the FAQ for more details. Your question would be on-topic on Unix & Linux however. – Chris S Jan 4 '13 at 16:44
  • Oh. Sorry. Forgot to read FAQ... – lindhe Jan 5 '13 at 18:07
3

Can you paste your umask settings of your FTP server's configuration file here?

For a VSFTPD server, it will be like this:

local_umask=022

umask 022 means the permission 755

umask 002 means the permission 775

FYI : Using umask, in Linux, we can decide the default permissions for a file/directory.

You may find more details regarding umask and how it's used in these two articles;

Umask value usage

Define umask

  • Where do I find the umask settings? – lindhe Jan 3 '13 at 19:27
  • If your FTP server is vsftpd, then configuration file will be /etc/vsftpd.conf by default. – Suku Jan 3 '13 at 19:29
  • @Lindhe94 as he mentioned, it depends on which ftp server you are using. What FTP server did you install? Or are you actually using sftp? – Zoredache Jan 3 '13 at 19:29
  • Yes, sorry. It is vsftpd I am using. Found the file. Just a minute and I'll paste the umask in my first post. – lindhe Jan 3 '13 at 19:34
  • Thank you! Now I understand! As you can see from what I pasted into my first post the umask is by default 077 (which I suppose mean -rw-------, since this is what I get?), but if I uncomment the last line it will change to 022, which is, as you mentioned, 755! Did I get it? :) – lindhe Jan 3 '13 at 19:48

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