pure-ftp doesn't work

Discussion in 'General' started by devdemi, Nov 20, 2010.

  1. devdemi

    devdemi New Member

    Hello!
    I try to connect to my host by I get error
    ftp: connect: Connection refused
    My /etc/pure-ftpd/db/mysql.conf file:
    Code:
    ##############################################
    #                                            #
    # Sample Pure-FTPd Mysql configuration file. #
    # See README.MySQL for explanations.         #
    #                                            #
    ##############################################
    
    
    # Optional : MySQL server name or IP. Don't define this for unix sockets.
    
    MYSQLServer     127.0.0.1
    
    
    # Optional : MySQL port. Don't define this if a local unix socket is used.
    
    # MYSQLPort       3306
    
    
    # Optional : define the location of mysql.sock if the server runs on this host.
    
    # MYSQLSocket      /var/run/mysqld/mysqld.sock
    
    
    # Mandatory : user to bind the server as.
    
    MYSQLUser       ispconfig
    
    
    # Mandatory : user password. You must have a password.
    
    MYSQLPassword   91c0eb614c5c46ff1fe6d7f89baa56d3
    
    
    # Mandatory : database to open.
    
    MYSQLDatabase   dbispconfig
    
    
    # Mandatory : how passwords are stored
    # Valid values are : "cleartext", "crypt", "md5" and "password"
    # ("password" = MySQL password() function)
    # You can also use "any" to try "crypt", "md5" *and* "password"
    
    MYSQLCrypt      crypt
    
    
    # In the following directives, parts of the strings are replaced at
    # run-time before performing queries :
    #
    # \L is replaced by the login of the user trying to authenticate.
    # \I is replaced by the IP address the user connected to.
    # \P is replaced by the port number the user connected to.
    # \R is replaced by the IP address the user connected from.
    # \D is replaced by the remote IP address, as a long decimal number.
    #
    # Very complex queries can be performed using these substitution strings,
    # especially for virtual hosting.
    
    
    # Query to execute in order to fetch the password
    
    MYSQLGetPW      SELECT password FROM ftp_user WHERE active = 'y' AND server_id = '1' AND username="\L"
    
    
    # Query to execute in order to fetch the system user name or uid
    
    MYSQLGetUID     SELECT uid FROM ftp_user WHERE active = 'y' AND server_id = '1' AND username="\L"
    
    
    # Optional : default UID - if set this overrides MYSQLGetUID
    
    #MYSQLDefaultUID 1000
    
    
    # Query to execute in order to fetch the system user group or gid
    
    MYSQLGetGID     SELECT gid FROM ftp_user WHERE active = 'y' AND server_id = '1' AND username="\L"
    
    
    # Optional : default GID - if set this overrides MYSQLGetGID
    
    #MYSQLDefaultGID 1000
    
    
    # Query to execute in order to fetch the home directory
    
    MYSQLGetDir     SELECT dir FROM ftp_user WHERE active = 'y' AND server_id = '1' AND username="\L"
    
    
    # Optional : query to get the maximal number of files 
    # Pure-FTPd must have been compiled with virtual quotas support.
    
    MySQLGetQTAFS  SELECT quota_files FROM ftp_user WHERE active = 'y' AND server_id = '1' AND quota_files != '-1' AND username="\L"
    
    
    # Optional : query to get the maximal disk usage (virtual quotas)
    # The number should be in Megabytes.
    # Pure-FTPd must have been compiled with virtual quotas support.
    
    MySQLGetQTASZ  SELECT quota_size FROM ftp_user WHERE active = 'y' AND server_id = '1' AND quota_files != '-1' AND username="\L"
    
    
    # Optional : ratios. The server has to be compiled with ratio support.
    
    MySQLGetRatioUL SELECT ul_ratio FROM ftp_user WHERE active = 'y' AND server_id = '1' AND quota_files != '-1' AND username="\L"
    MySQLGetRatioDL SELECT dl_ratio FROM ftp_user WHERE active = 'y' AND server_id = '1' AND quota_files != '-1' AND username="\L"
    
    
    # Optional : bandwidth throttling.
    # The server has to be compiled with throttling support.
    # Values are in KB/s .
    
    MySQLGetBandwidthUL SELECT ul_bandwidth FROM ftp_user WHERE active = 'y' AND server_id = '1' AND quota_files != '-1' AND username="\L"
    MySQLGetBandwidthDL SELECT dl_bandwidth FROM ftp_user WHERE active = 'y' AND server_id = '1' AND quota_files != '-1' AND username="\L"
    
    # Enable ~ expansion. NEVER ENABLE THIS BLINDLY UNLESS :
    # 1) You know what you are doing.
    # 2) Real and virtual users match.
    
    # MySQLForceTildeExpansion 1
    
    
    # If you upgraded your tables to transactionnal tables (Gemini,
    # BerkeleyDB, Innobase...), you can enable SQL transactions to
    # avoid races. Leave this commented if you are using the
    # traditionnal MyIsam databases or old (< 3.23.x) MySQL versions.
    
    MySQLTransactions On
    
    
    ps aux | grep pure-ftpd
    root 17994 0.0 0.0 4724 748 pts/0 S+ 14:36 0:00 grep pure-ftpd
    Also I created symlink ln -sf /usr/sbin/pure-ftpd-mysql /usr/sbin/pure-ftpd
    because I got error:
    Can't exec "/usr/sbin/pure-ftpd": No such file or directory
    at /usr/sbin/pure-ftpd-wrapper line 174.

    What do I need to do?
     
  2. devdemi

    devdemi New Member

    my /etc/default/pure-ftpd-common file
    Code:
    
    # Configuration for pure-ftpd
    # (this file is sourced by /bin/sh, edit accordingly)
    
    # STANDALONE_OR_INETD
    # valid values are "standalone" and "inetd".
    # Any change here overrides the setting in debconf.
    STANDALONE_OR_INETD=standalone
    
    # VIRTUALCHROOT:
    # whether to use binary with virtualchroot support
    # valid values are "true" or "false"
    # Any change here overrides the setting in debconf.
    VIRTUALCHROOT=true
    
    # UPLOADSCRIPT: if this is set and the daemon is run in standalone mode,
    # pure-uploadscript will also be run to spawn the program given below
    # for handling uploads. see /usr/share/doc/pure-ftpd/README.gz or
    # pure-uploadscript(8)
    
    # example: UPLOADSCRIPT=/usr/local/sbin/uploadhandler.pl
    UPLOADSCRIPT=
    
    # if set, pure-uploadscript will spawn $UPLOADSCRIPT running as the
    # given uid and gid
    UPLOADUID=
    UPLOADGID=
    
    
     
  3. falko

    falko Super Moderator Howtoforge Staff

    What are the outputs of
    Code:
    netstat -tap
    and
    Code:
    iptables -L
    ?
    Did you try active and passive transfers in your FTP client?
     
  4. devdemi

    devdemi New Member

    netstat -tap
    Code:
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp        0      0 *:ssh                   *:*                     LISTEN      32238/sshd      
    tcp        0      0 *:smtp                  *:*                     LISTEN      32637/master    
    tcp        0      0 *:https                 *:*                     LISTEN      4058/apache2    
    tcp        0      0 localhost.localdoma:614 *:*                     LISTEN      3406/famd       
    tcp        0      0 localhost.localdo:10024 *:*                     LISTEN      3696/amavisd (ch13-
    tcp        0      0 localhost.localdo:10025 *:*                     LISTEN      32637/master    
    tcp        0      0 localhost.localdo:mysql *:*                     LISTEN      27826/mysqld    
    tcp        0      0 localhost.localdo:spamd *:*                     LISTEN      28621/spamd.pid 
    tcp        0      0 *:sunrpc                *:*                     LISTEN      23777/portmap   
    tcp        0      0 *:http-alt              *:*                     LISTEN      4058/apache2    
    tcp        0      0 *:www                   *:*                     LISTEN      4058/apache2    
    tcp        0      0 localhost.localdo:57034 localhost.localdo:mysql ESTABLISHED 5255/amavisd (ch12-
    tcp        0      0 localhost.localdo:48526 localhost.localdo:mysql ESTABLISHED 3696/amavisd (ch13-
    tcp        0      0 localhost.localdo:mysql localhost.localdo:48526 ESTABLISHED 27826/mysqld    
    tcp        0      0 localhost.localdo:mysql localhost.localdo:57034 ESTABLISHED 27826/mysqld    
    tcp        0    240 euve11431.vserver.d:ssh an911.datasvit.km:18674 ESTABLISHED 12202/0         
    tcp6       0      0 [::]:ssh                [::]:*                  LISTEN      32238/sshd      
    tcp6       0      0 [::]:imaps              [::]:*                  LISTEN      30457/couriertcpd
    tcp6       0      0 [::]:pop3s              [::]:*                  LISTEN      30555/couriertcpd
    tcp6       0      0 [::]:pop3               [::]:*                  LISTEN      30473/couriertcpd
    tcp6       0      0 [::]:imap2              [::]:*                  LISTEN      30402/couriertcpd
    
    iptables -L:
    Code:
    Chain INPUT (policy ACCEPT)
    target     prot opt source               destination         
    fail2ban-ssh  tcp  --  anywhere             anywhere            fail2ban-ssh  tcp  --  anywhere             anywhere            fail2ban-ssh  tcp  --  anywhere             anywhere            multiport dports ssh 
    
    Chain FORWARD (policy ACCEPT)
    target     prot opt source               destination         
    
    Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination         
    
    Chain fail2ban-ssh (1 references)
    target     prot opt source               destination         
    RETURN     all  --  anywhere             anywhere 
    I tried to write in console:
    #ftp
    ftp> open mydomain.com
    ftp: connect: Connection refused
     
  5. falko

    falko Super Moderator Howtoforge Staff

    PureFTPd isn't running. Which distribution do you use? Which tutorial (URL) did you use to set up the system?

    Is this a physical server or a virtual machine?
     
  6. devdemi

    devdemi New Member

  7. falko

    falko Super Moderator Howtoforge Staff

Share This Page