1
1
I am still learning Ubuntu 16.04. Here is my situation with ftp failure. I installed vsftpd on my Unbuntu server two months ago and when I was working on it the past Sunday, everything was fine. But now I try to connect to ftp but obtain the result "Connection refused", like this:
ftp: connect to address ::1: Connection refused
Trying 127.0.0.1...
ftp: connect: Connection refused
Here is what /var/log/syslog says:
Jun 27 19:36:22 ubuntu systemd[1]: Starting vsftpd FTP server...
Jun 27 19:36:22 ubuntu systemd[1]: Started vsftpd FTP server.
Jun 27 19:36:22 ubuntu systemd[1]: vsftpd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Jun 27 19:36:22 ubuntu systemd[1]: vsftpd.service: Unit entered failed state.
Jun 27 19:36:22 ubuntu systemd[1]: vsftpd.service: Failed with result 'exit-code'.
I've searched online for solutions and tried but with no good result. I've also checked the iptables, they are empty like this:
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
...which means nothing being hold in the iptables, right?... and this is my vsftpd.conf:
listen=YES
listen_ipv6=YES
anonymous_enable=YES
local_enable=YES
write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/vsftpd.log
chroot_local_user=YES
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
guest_enable=YES
guest_username=workers
user_config_dir=/etc/vsftpd/userconfig/
user_sub_token=$USER
local_root=/home/work/$USER
hide_id=YES
allow_writeable_chroot=YES
local_umask=022
pasv_enable=YES
pasv_min_port=64000
pasv_max_port=65535
I really have no clue of what's wrong with vsftpd on my server.
What command did you use to start fsftpd, and is there anything in /var/log/vsftpd.log or /var/log/syslog ? Also, have a look athttps://unix.stackexchange.com/questions/181436/vsftpd-wont-start#310010 - maybe you need to chown root:root /etc/vsftp.conf
– davidgo – 2017-06-28T08:16:16.483Most of the time, i use
sudo service vsftpd restart
to restart vsftpd, also usesudo /etc/init.d/vsftpd restart
to restart. Yes, I've looked at that link before I posted my question here 'cuz it doesn't help. And the permission for /etc/vsftpd.conf is root root. – gabi – 2017-06-28T08:34:56.690