0

Short introduction: I'm fairly new to Unix-Systems and got a Raspberry 3b+ using it as a Web-Server. Obviously I'm using a different computer for development and transfer the files via sftp. Always running into permission-problems after file transfers I checked my ftp-server (proftpd) for problems (umask) and noticed that whatever the umask in the config nothing changes in the actual file permissions, not even when i change the umask to 777. I got a hint of looking into user-umasks which I then persued and led meto something which i think is the actual problem.

Problem: I'm currently using the standard "pi" user. Whenever i create a file (doesn't matter if i use touch in bash or rightclick - new in file manager) in any directory (for testing purposes i used /home/pi/Desktop/) it's created with 640 permissions.

What i checked:

  • umask command: says 022, changing to 000 results in file created with 660 permissions
  • /etc/profile: no umask there (i also learned it's the wrong place, but early search led me there)
  • /etc/login.defs: has umask set to 022
  • /etc/pam.d/: no umask set in any file
  • .bashrc: no umask set

Can anyone tell me what i can do so files get created with 644 permissions?

If i'm missing something obvious bonus-thanks if you explain how i could've googled it myself.

beginner
  • 1
  • 2

3 Answers3

0

Set Umask 022 in /etc/proftpd/proftpd.conf

Umask 022 022

The second 022 is for directories.

Gerard H. Pille
  • 2,469
  • 1
  • 12
  • 10
0

Check if one of the parent directories has an ACL (access control list). An "ls -l" will show a "+" if that is the case, as in:

drwxrwxr-x+ 2 ghp  ghp  4096 Apr 26 19:23 .

Check the ACL, if there is a "default":

$ getfacl .
# file: .
# owner: ghp
# group: ghp
user::rwx
user:pi:rwx
group::r-x
mask::rwx
other::r-x
default:user::rwx
default:group::rw-
default:other::---
Gerard H. Pille
  • 2,469
  • 1
  • 12
  • 10
0

I promise to give up after this one:

Your problem is not caused by proftpd, but by sftp-server.

Did you disable

Subsystem sftp /usr/lib/openssh/sftp-server

in /etc/ssh/sshd_config? You can set the umask of sftp-server with the -u option.

Gerard H. Pille
  • 2,469
  • 1
  • 12
  • 10
  • you've given up even before you proposed your answer... read the "problem"-part... ANY user creates files with 640 even the pi logged in directly.. and it's not ssh related because it's the same for local user – beginner Apr 26 '20 at 20:05
  • I'm almost out of ideas. – Gerard H. Pille Apr 26 '20 at 20:14