Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

closed as off topic by Shane Madden, mdpc, Michael Hampton, Ward, dunxd Jan 4 '13 at 11:20

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

    
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... –  Lindhea Jan 5 '13 at 18:07

1 Answer 1

up vote 2 down vote accepted

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

share|improve this answer
    
Where do I find the umask settings? –  Lindhea 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. –  Lindhea 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? :) –  Lindhea Jan 3 '13 at 19:48

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