Learn about Centmin Mod LEMP Stack today
Register Now

Issue with Pure-FTP

Discussion in 'System Administration' started by KlueMaster, Jan 24, 2025.

Tags:
  1. KlueMaster

    KlueMaster Member

    78
    11
    8
    Aug 5, 2017
    Ratings:
    +32
    Local Time:
    10:19 AM
    MariaDB 10
    Hello everyone,


    I've recently migrated my CMM based server from CentOS to AlmaLinux using the back-up and restore options.

    However, post migration, none of the FTP accounts work. Even creating fresh accounts using pure-pw do not work. All are facing the same issue as below:
    Code (Text):
    Status: Connecting to ...
    Status: Connection established, waiting for welcome message...
    Status: Initializing TLS...
    Status: TLS connection established.
    Status: Logged in
    Status: Retrieving directory listing of "/"...
    Command: CWD /
    Response: 550 Can't change directory to /: Permission denied
    Command: PWD
    Response: 257 "/" is your current location
    Command: TYPE I
    Response: 200 TYPE is now 8-bit binary
    Command: PASV
    Response: 227 Entering Passive Mode (...)
    Command: MLSD
    Response: 550 Can't check for file existence
    Error: Failed to retrieve directory listing
    


    Corresponding directory has the following permission:
    Code (Text):
    drwxr-s---  7 nginx nginx  4096 Jan 23 08:12 .
     
  2. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    2:49 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    Does the command below list the pure-ftpd virtual FTP user accounts on restored/migrated server
    Code (Text):
    pure-pw list
    

    You could reset their passwords/users if you want Pure-FTPD Virtual FTP Users - CentminMod.com LEMP Nginx web stack for CentOS, AlmaLinux, Rocky Linux

    Which version of Centmin Mod 131.00stable or 140.00beta01?

    How did you migrate the data and sites? Using centmin.sh menu option 21 https://centminmod.com/menu21-140.00beta01 ? If so which menu options? How did you restore the data? if you followed the migration step restore options from https://github.com/centminmod/centm...te-centmin-mod-data-to-new-centmin-mod-server which outlines same instructions as https://github.com/centminmod/centm...-nginx-vhosts-data--mariabackup-mysql-backups, then for pure-ftpd you would have at least checked restore staging copy of pure-ftpd files/database to new servers

    Code (Text):
    diff -ur /etc/pure-ftpd /home/restoredata/etc/pure-ftpd
    

    then restored it by overwriting existing one
    Code (Text):
    \cp -af /home/restoredata/etc/pure-ftpd/* /etc/pure-ftpd/
    

    but you might need to also run command
    Code (Text):
    pure-pw mkdb
    

    then restart pure-ftpd
    Code (Text):
    systemctl restart pure-ftpd
    

    let me know if that works.
     
  3. KlueMaster

    KlueMaster Member

    78
    11
    8
    Aug 5, 2017
    Ratings:
    +32
    Local Time:
    10:19 AM
    MariaDB 10
    Actually did all of these, including restoring by copying.
    FTP users exist, and are chrooted to respective folders. Authentication goes alright. But it fails while changing to the chrooted folder.
    Code (Text):
    Status: Logged in
    Status: Retrieving directory listing of "/"...
    Command: CWD /
    Response: 550 Can't change directory to /: Permission denied
    

    Code (Text):
    Command: PWD
    Response: 257 "/" is your current location
    Command: TYPE I
    Response: 200 TYPE is now 8-bit binary
    Command: PASV
    Response: 227 Entering Passive Mode (...)
    Command: MLSD
    Response: 550 Can't check for file existence
    Error: Failed to retrieve directory listing
    
     
  4. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    2:49 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    which ftp client you using? did you ensure passive FTP mode + Explicit FTP over TLS/SSL is configured Pure-FTPD Virtual FTP Users - CentminMod.com LEMP Nginx web stack for CentOS, AlmaLinux, Rocky Linux

    ensure permissions are correct
    Code (Text):
    chown -R nginx:nginx /home/nginx/domains/yourdomain.com/public


    you did verify that directories exist for /home/nginx/domains/yourdomain.com/public

    check the directory permissions/user/group using tree
    Code (Text):
    yum -y install tree

    Code (Text):
    tree -d -L 2 -f -p -u -g /home/nginx/domains

    i.e.
    Code (Text):
    tree -d -L 2 -f -p -u -g /home/nginx/domains
    /home/nginx/domains
    ├── [drwxr-x--- nginx    nginx   ]  /home/nginx/domains/demodomain.com
    │   ├── [drwxr-x--- nginx    nginx   ]  /home/nginx/domains/demodomain.com/backup
    │   ├── [drwxr-x--- nginx    nginx   ]  /home/nginx/domains/demodomain.com/log
    │   ├── [drwxr-x--- nginx    nginx   ]  /home/nginx/domains/demodomain.com/private
    │   └── [drwxr-x--- nginx    nginx   ]  /home/nginx/domains/demodomain.com/public
    └── [drwxr-s--- nginx    nginx   ]  /home/nginx/domains/domain1.com
        ├── [drwxr-s--- nginx    nginx   ]  /home/nginx/domains/domain1.com/backup
        ├── [drwxr-s--- nginx    nginx   ]  /home/nginx/domains/domain1.com/log
        ├── [drwxr-s--- nginx    nginx   ]  /home/nginx/domains/domain1.com/private
        └── [drwxr-s--- nginx    nginx   ]  /home/nginx/domains/domain1.com/public
    
    10 directories
    
     
  5. gszabi

    gszabi New Member

    5
    0
    1
    Dec 18, 2021
    Ratings:
    +3
    Local Time:
    6:49 AM
    Last edited: Feb 18, 2025
  6. gszabi

    gszabi New Member

    5
    0
    1
    Dec 18, 2021
    Ratings:
    +3
    Local Time:
    6:49 AM
    My problem has been solved. I had to do this:
    Code:
    /usr/local/src/centminmod/tools/switch_pureftpd_uid.sh -u 1068 -g 1068
    
    Because the FTP users from the old server had the 1000 user and group id. (so the nginx user).
     
  7. mknobbe

    mknobbe New Member

    16
    3
    3
    Jul 12, 2022
    Ratings:
    +13
    Local Time:
    11:49 PM
    Nginx 1.31.0
    Maria DB 11.4.x
    Had the same issue after transferreing from Centos to AlmaLinux. Running the uid upgrade script fixed my issue as well
     
  8. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    2:49 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    Thanks for providing your experience - always useful to know when stuff works for users too :D