Get the most out of your Centmin Mod LEMP stack
Become a Member

Pure-FTPD Unable to connect with any vhost FTP user

Discussion in 'Other Centmin Mod Installed software' started by ShaneVG, Jul 4, 2024.

  1. eva2000

    eva2000 Administrator Staff Member

    58,895
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    8:37 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    Ok just change the pure-ftpd virtual ftp user's uid/gid via command where UCgpXJJfiFDMN6q is your username
    Code (Text):
    pure-pw usermod UCgpXJJfiFDMN6q -u 1068 -g 1068
    pure-pw mkdb
    

    inspect it's change
    Code (Text):
    pure-pw show UCgpXJJfiFDMN6q
    

    note password displayed is encrypted/hashed from show command

     
  2. eva2000

    eva2000 Administrator Staff Member

    58,895
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    8:37 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
  3. ShaneVG

    ShaneVG New Member

    15
    1
    3
    Mar 2, 2022
    Ratings:
    +2
    Local Time:
    12:37 PM
    1.21.4
    Yes that works! Thanks for the support. <3
     
  4. Itworx4me

    Itworx4me Premium Member Premium Member

    339
    35
    28
    Mar 14, 2017
    Ratings:
    +65
    Local Time:
    3:37 AM
    Nginx 1.27.4
    MariaDB 10.6.21
    I am getting this error on the current 140.00beta01. Running this code
    Code (Text):
    /usr/local/src/centminmod/tools/switch_pureftpd_uid.sh -u 1068 -g 1068

    Changes all pureftp users to have the 1068. After running the code it locks me out of all ftp sites. Running the code again to 1000 lets me back into my ftp sites. It will not let me into the vhost site that was created using 140.00beta01. Need help

    Thanks,
    Itworx4me
     
  5. eva2000

    eva2000 Administrator Staff Member

    58,895
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    8:37 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    When was 140.00beta01 initially installed? It should have been fixed since July 7, 2024, and you shouldn't need to change the nginx uid/gid.

    As per https://community.centminmod.com/th...on-failed-on-131-00stable-140-00beta01.25738/ there's 2 scripts for nginx id and pure-ftpd id. You only ran on pure-ftpd id change only.

    what is output for
    Code (Text):
    id nginx

    if UID/GID greater than 1000 i.e. 1068 that is correct. If it's <1000 i.e. 958 then it needs changing using tools/switch_nginx_uid.sh script (FYI, July 7, 2024 onwards there was auto fix that doesn't require running this script).

    So -uf and -gf are uid/gid from and -ut and -gt are uid/gid to. So changing from uid/gid = 958 to uid/gid = 1068 would be:

    Code (Text):
    /usr/local/src/centminmod/tools/switch_nginx_uid.sh -uf 958 -gf 958 -ut 1068 -gt 1068


    then change pure-ftpd virtual user's UID/GID to same matching 1068 id
    Code (Text):
    /usr/local/src/centminmod/tools/switch_pureftpd_uid.sh -u 1068 -g 1068
    
     
  6. Itworx4me

    Itworx4me Premium Member Premium Member

    339
    35
    28
    Mar 14, 2017
    Ratings:
    +65
    Local Time:
    3:37 AM
    Nginx 1.27.4
    MariaDB 10.6.21
    I upgraded from 130.00beta to 140.00beta01 about week ago.

    Code (Text):
    uid=1000(nginx) gid=1000(nginx) groups=1000(nginx)
     
  7. Itworx4me

    Itworx4me Premium Member Premium Member

    339
    35
    28
    Mar 14, 2017
    Ratings:
    +65
    Local Time:
    3:37 AM
    Nginx 1.27.4
    MariaDB 10.6.21
    Code (Text):
    pure-pw show Noah
    
    Login              : Noah
    Password           : $2a$10$eWFdFbK/qUD4OYQo3CICuRUP32NBwlFqd04y3h5EfQmIE3V4aEG
    UID                : 1000 (nginx)
    GID                : 1000 (nginx)
    Directory          : /home/nginx/domains/domain.com/./
    Full name          :
    Download bandwidth : 0 Kb (unlimited)
    Upload   bandwidth : 0 Kb (unlimited)
    Max files          : 0 (unlimited)
    Max size           : 0 Mb (unlimited)
    Ratio              : 0:0 (unlimited:unlimited)
    Allowed local  IPs :
    Denied  local  IPs :
    Allowed client IPs :
    Denied  client IPs :
    Time restrictions  : 0000-0000 (unlimited)
    Max sim sessions   : 0 (unlimited)
     
  8. Itworx4me

    Itworx4me Premium Member Premium Member

    339
    35
    28
    Mar 14, 2017
    Ratings:
    +65
    Local Time:
    3:37 AM
    Nginx 1.27.4
    MariaDB 10.6.21
    Running this code gave me this result:
    Code (Text):
    /usr/local/src/centminmod/tools/switch_nginx_uid.sh -uf 958 -gf 958 -ut 1068 -gt 1068
    Using UID/GID: 1068
    Stopping nginx service...
    nginx user UID/GID is 1000:1000, not 958:958. No changes made.
    Restarting nginx service...
    Verifying ownership of critical directories...
    Ownership of /home/nginx is incorrect: UID=1000, GID=1000 (expected UID=1068, GID=1068)


    Running this code:
    Code (Text):
    /usr/local/src/centminmod/tools/switch_pureftpd_uid.sh -u 1068 -g 1068

    Give me this error when trying to log on:
    Code (Text):
    550 Can't check for file existence

    If I use this code to revert back:
    Code (Text):
    /usr/local/src/centminmod/tools/switch_pureftpd_uid.sh -u 1000 -g 1000

    Allows me to access the FTP again.
     
  9. eva2000

    eva2000 Administrator Staff Member

    58,895
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    8:37 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    In that case you never had to run anything but now just run the tool to set pure-ftpd tool to set uid/gid to match Nginx's 1000
    Code (Text):
    /usr/local/src/centminmod/tools/switch_pureftpd_uid.sh -u 1000 -g 1000