1

I am running Raspbian Jessie Lite (released on Mar 18, 2016). Just installed vsftpd, here is my configuration:

listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/vsftpd.log
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO

I can login with user pi, and can view any folder with WinSCP. But I cannot mkdir in any folder like /home/pi or /tmp or even /home/pi/0777_folder. Write files or create files is also not possible.

I cannot login with user root.

Please help me out. What's wrong? I cannot find anywhere else to configure this. Thank you in advance.

1

I think local_umask=022 is the problem. That means that you give permissions 755, so only root can do everything, other people can just read and execute. Which would figure in with you being able to see directories, but not being able to create any.

Maybe

local_umask=000 

or, probably better,

local_umask = 002

would fix it.

Then you could work your way to the permissions you need. (umask removes permissions where chmod gives them. It masks, after all ;) So you subtract the values from 7 to get the permissions: umask 022 = permissions 755.)

Also, you need to give root a password to log in as root:

$ sudo passwd root 
| improve this answer | |
  • Thank you @krork. It works for me to create file now by changing local_umask to "000". But as I login ftp with user "pi", shouldn't the vstpd works as user "pi" (has the same permissions like user "pi")? And "pi" is able to chmod its own files (add or remove permissions). So my question is Why it needs root privileges to take permissions away when using local_umask 022? – lesca May 11 '16 at 11:41
  • vsftpd uses the umask and its associated permissions as additional security. I'm not sure why you need root, possibly vsftpd uses its own user, not Pi, to login? You can check your /etc/passwd files to look for a user called vsftpd, if you like. – curious_weather May 11 '16 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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