ftp: connect :Connection refused

19,625

I finally found a way to solve my problem.That was reinstalling vsftpd,and directly ran the service instead of after configuring.And it turned out that the /etc/vsftpd.conffile was the point.So I just added what I needed and tested vsftpd service after every adding action.

Share:
19,625
EmmaYXY
Author by

EmmaYXY

Updated on September 18, 2022

Comments

  • EmmaYXY
    EmmaYXY over 1 year

    I have got an IP address from BandwagonHOST, and created a user with root privilege:

    root    ALL=(ALL:ALL) ALL
    shaw    ALL=(ALL:ALL) ALL
    

    installed vsftpd:

    sudo apt-get install vsftpd
    sudo ufw status
    Status:inactive
    

    copied /etc/vsftpd.conffrom /etc/vsftpd.orig and configued it like the following:

    anonymous_enable=NO# Example config file /etc/vsftpd.conf
    local_enable=YES
    write_enable=YES
    check_shell=NO
    local_umask=000
    xferlog_enable=YES
    connect_from_port_20=YES
    xferlog_file=/var/log/vsftpd.log
    ftpd_banner=You made it!
    xferlog_std_format=YES
    chroot_local_user=YES
    allow_writeable_chroot=YES
    listen=NO
    seccomp_sandbox=NO
    userlist_enable=YES
    userlist_file=/etc/vsftpd.userlist
    userlist_deny=NO
    listen_ipv4=YES
    

    then I tried to test it and got this:

    root@ubuntu:/# cat /etc/vsftpd.userlist
    shaw
    
    root@ubuntu:/# su - shaw
    shaw@ubuntu:~$ ftp 172.93.34.44
    ftp: connect: Connection refused
    ftp>
    

    Any help will be appreciated.

    The following is edited content:

    I did miss the command service vsftpd start, and after that , got another problem:

    initctl: Unable to connect to system bus: Failed to connect to socket 
    /var/run/dbus/system_bus_socket: No such file or directory 
    vsftpd: unrecognized service.
    

    And the command sudo service status gave me the information vsftpd stop/waiting

    Thank u for helping me.

    • Patrick Mevzek
      Patrick Mevzek over 6 years
      Are you sure the vsftpd daemon is running?
    • EmmaYXY
      EmmaYXY over 6 years
      Thank u for that! I did miss the command service vsftpd start, and after that , got another problem:initctl: Unable to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory vsftpd: unrecognized service. And the command sudo service status gave me the information vsftpd stop/waiting . I got no idea how to fix it right after searching. Can you be so kind to give a little hint?