0

I installed vsftpd and I can login with the new user sftp to the server. But if I create a new file via FileZilla the new file has got 755 permission and its group is not www-data (33).

Screenshot FileZilla

How can I fix this? I want to have correct permissions on new created or uploaded or modified files. And the group of new files and directories should be www-data.

/etc/vsftpd.conf:

# FTP
listen=NO
listen_ipv6=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
chroot_local_user=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
force_dot_files=YES
pasv_min_port=40000
pasv_max_port=50000
allow_writeable_chroot=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
file_open_mode=0777
force_dot_files=YES


# SSL
ssl_enable=YES
rsa_cert_file=/etc/ssl/private/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.pem
allow_anon_ssl=NO
force_local_data_ssl=YES
force_local_logins_ssl=YES
ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO
require_ssl_reuse=NO
ssl_ciphers=HIGH

Thanks.

kanka.dev
  • 21
  • 1
  • 1
  • 3
  • By configuring an SSL/TLS certificate in VSFTP you're setting up an SSL secured FTP server. That protocol is [FTPS](http://en.wikipedia.org/wiki/FTPS). That protocol is often confused with the incompatible SSH File Transfer Protocol; [SFTP](http://en.wikipedia.org/wiki/SSH_File_Transfer_Protocol). That protocol is often confused with the incompatible SSH File Transfer Protocol; [SFTP][2]. You obviously can't test the VSFTP configuration with an sftp client. – Rob Jul 26 '22 at 15:08
  • As you can see in the screenshot I can use FileZilla to connect with the server, I can create new files, upload, download. My question is different. – kanka.dev Jul 26 '22 at 17:59
  • The FileZilla Client supports ***both*** FTP over TLS (FTPS) and SFTP. You explicitly say that you connect with `SFTP` in your question. You then start talking about settings for vsftpd, which only provides `FTPS`. Whatever you configure in vsftpd YOU CANNOT TEST THAT when you use SFTP to connect over the SSH port using the SFTP protocol. – Rob Jul 27 '22 at 19:01
  • No, i said I connect with the USER `stfp`. The protocol doesn't matter. My question is about configuring the FTP / Apache server. Thank you though. – kanka.dev Jul 27 '22 at 21:29

0 Answers0