2

On a CentOS Linux 7.3.1611 I have VirtualMin installed. From the Edit Users on the left I have created a new user with FTP access not to use the root account everywhere.

new user creation

However, whenever I try to login via winSCP using both FTP & SFTP, I get either a username password error (case of SFTP) or getting a connection error (case of FTP)

ftp error

error sftp

Is this a common issue and how can I fix it?

tony9099
  • 167
  • 1
  • 1
  • 9

1 Answers1

0

Vsftpd will refuse to open a connection and return error 500 if the ftp root directory for the user which is attempting the connection is writeable. Below you can see a reasonable vsptd.conf which allows permission for local users.

So if we want user1 to be able to connect and his home folder is /home/user1 we must set:

sudo chmod a-w /home/user1

To be able to work within the FTP directory we must create a couple separate folders with write permisions. i.e:

/home/user1/downloads/
/home/user1/uploads/

My /etc/vsftpd.conf

listen=YES <br>
anonymous_enable=NO <br>
local_enable=YES <br>
write_enable=YES <br>
dirmessage_enable=YES <br>
use_localtime=YES <br>
xferlog_enable=YES <br>
connect_from_port_20=YES <br>
chroot_local_user=YES <br>
secure_chroot_dir=/var/run/vsftpd/empty <br>
pam_service_name=vsftpd <br>
rsa_cert_file=/etc/ssl/private/vsftpd.pem <br>

If your problem persists please use a different FTP client (like Filezilla) and post the exact error which is returned by your server.