Join the community today
Become a Member

vhost FTP user no permissions

Discussion in 'Other Centmin Mod Installed software' started by Rdurty2, Dec 15, 2015.

  1. Rdurty2

    Rdurty2 Member

    38
    9
    8
    Oct 31, 2015
    Ratings:
    +12
    Local Time:
    5:14 AM
    1.11.4
    10.0.27
    I've been a bit confused lately by FTP setup.

    I added my vhost and specified an FTP user for it. Shouldn't this user be able to upload files to the vhost? This user account is only able to upload to it's own home directory.

    In order for me to upload files to the vhost I need to log in as root. This does not seem right.

    What am I missing here?

     
  2. eva2000

    eva2000 Administrator Staff Member

    55,417
    12,256
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,837
    Local Time:
    7:14 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    As per outlined info at Pure-FTPD Virtual FTP Users - CentminMod.com LEMP Nginx web stack for CentOS pure-ftpd virtual ftp user is locked to vhost directory at /home/nginx/domains/domain1.com/ and no higher so you upload webroot files for your scripts to /home/nginx/domains/domain1.com/public

    Getting started guide step 2 also outlines this

    If you need access to /usr/local/nginx/conf/conf.d/* you will need root user access. No sane and secure system will ever give normal ftp user access to root/server level files at nginx configuration level :)
     
  3. Rdurty2

    Rdurty2 Member

    38
    9
    8
    Oct 31, 2015
    Ratings:
    +12
    Local Time:
    5:14 AM
    1.11.4
    10.0.27
    I know all of the above as I always make sure to read through the docs before posting. My FTP user that was created with the vhost does not have any permissions to /home/nginx/domains/domain.com
     
  4. eva2000

    eva2000 Administrator Staff Member

    55,417
    12,256
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,837
    Local Time:
    7:14 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    it should i've tested and use it without issues

    if you enable ftp client verbose or logging you will see what errors you get
     
  5. eva2000

    eva2000 Administrator Staff Member

    55,417
    12,256
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,837
    Local Time:
    7:14 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    use pure-pw command to verify

    list all pure-ftpd created virtual FTP users
    Code:
    pure-pw list
    Code:
    pure-pw list
    ftpuser             /usr/local/nginx/html/./                          
    ftpuser2            /usr/local/nginx/html/./                          
    ftpuser3            /usr/local/nginx/html/./                          
    ftpuser4            /home/nginx/domains/domain1.com/./                
    ftpuser6            /home/nginx/domains/sub.domain1.com/./             
    ftpuser5            /home/nginx/domains/domain2.com/./
    show full details for an specific pure-ftpd virtual FTP user
    Code:
    pure-pw show FTPUSERNAME
    password is encrypted

    Code:
    pure-pw show ftpuser5
    
    Login              : ftpuser5
    Password           : $1$msgfvdN0$51dhLdPGiCQpQEwtZ30kF1
    UID                : 500 (nginx)
    GID                : 500 (nginx)
    Directory          : /home/nginx/domains/domain2.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)
     
  6. Rdurty2

    Rdurty2 Member

    38
    9
    8
    Oct 31, 2015
    Ratings:
    +12
    Local Time:
    5:14 AM
    1.11.4
    10.0.27
    Thanks for the help. As usual it was a misconfig on my side.

    I had set up the FTP connection to use my non-root CentOS account. Once I changed that to the ftp account (same user name) it worked. I feel so dumb lol