Discover Centmin Mod today
Register Now

create FTP user - Error: 'You must give nonroot uid and gid'

Discussion in 'Other Centmin Mod Installed software' started by Akshat, Mar 16, 2017.

Tags:
  1. Akshat

    Akshat New Member

    2
    1
    3
    Mar 16, 2017
    Ratings:
    +1
    Local Time:
    6:09 AM
    Total Noob Question:

    This is my first time setting up a VPS and ftp user, following is what I did.

    1. Launch a Linode.com server using the a stackscript.
    2. Ran Centmin mod to install virtual host on that server (Centmin Mod Nginx Vhost)
    It asked to give a ftp username and password and I gave that.
    3. Restarted the ftp service using

    Quote:
    pure-pw mkdb && service pure-ftpd restart
    But I want unable to access it via ftp so I tried creating another user via the following command in SSH

    Quote:
    pure-pw useradd ftpuser -u nginx -g nginx -d /home/nginx/domains/
    but It gives me an error "You must give nonroot uid and gid".

    I am stuck, how can create a master user to access ftp.

    What should I do?
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,178
    6,786
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,139
    Local Time:
    10:39 AM
    Nginx 1.13.x
    MariaDB 5.5
    how did you create the nginx vhost site ? via centmin.sh menu option 2 or via /usr/bin/nv command ?

    you don't need to do that if you used centmin.sh menu option 2 or nv command to create nginx vhost site

    which centmin mod version ? 123.08stable or 123.09beta01 ?

    I just tested centmin.sh menu option 2 to create testdomain.com and that works
    Code (Text):
    --------------------------------------------------------
         Centmin Mod Menu 123.09beta01 centminmod.com    
    --------------------------------------------------------
    1).  Centmin Install
    2).  Add Nginx vhost domain
    3).  NSD setup domain name DNS
    4).  Nginx Upgrade / Downgrade
    5).  PHP Upgrade / Downgrade
    6).  XCache Re-install
    7).  APC Cache Re-install
    8).  XCache Install
    9).  APC Cache Install
    10). Memcached Server Re-install
    11). MariaDB MySQL Upgrade & Management
    12). Zend OpCache Install/Re-install
    13). Install/Reinstall Redis PHP Extension
    14). SELinux disable
    15). Install/Reinstall ImagicK PHP Extension
    16). Change SSHD Port Number
    17). Multi-thread compression: pigz,pbzip2,lbzip2...
    18). Suhosin PHP Extension install
    19). Install FFMPEG and FFMPEG PHP Extension
    20). NSD Install/Re-Install
    21). Update - Nginx + PHP-FPM + Siege
    22). Add Wordpress Nginx vhost + Cache Plugin
    23). Update Centmin Mod Code Base
    24). Exit
    --------------------------------------------------------
    Enter option [ 1 - 24 ] 2
    --------------------------------------------------------
    

    Code (Text):
    ---------------------------------------------------------------
    Important Information
    ---------------------------------------------------------------
    
    You are about to create an Nginx vhost site account with/without
    HTTPS/SSL support. Details of this process are outlined on site
    at centminmod.com/nginx_domain_dns_setup.html. Also read the
    continually updated Getting Started Guide for Centmin Mod usage
    at centminmod.com/getstarted.html which covers the pure-ftpd
    ftp username that is auto generated with the Nginx vhost site.
    
    Do you want to continue with Nginx vhost site creation ? [y/n] y
    
    Enter vhost domain name to add (without www. prefix): testdomain.com
    
    Create a self-signed SSL certificate Nginx vhost? [y/n]: n
    
    Create FTP username for vhost domain (enter username): ftp1
    Auto generate FTP password (recommended) [y/n]: y
    
    FTP username you entered: ftp1
    FTP password auto generated: ofxYlqU8byiSjwf5KMpRp
    


    Code (Text):
    -------------------------------------------------------------
    FTP hostname : MYSERVERIP
    FTP port : 21
    FTP mode : FTP (explicit SSL)
    FTP Passive (PASV) : ensure is checked/enabled
    FTP username created for testdomain.com : ftp1
    FTP password created for testdomain.com : ofxYlqU8byiSjwf5KMpRp
    -------------------------------------------------------------
    vhost for testdomain.com created successfully
    
    domain: http://testdomain.com
    vhost conf file for testdomain.com created: /usr/local/nginx/conf/conf.d/testdomain.com.conf
    
    upload files to /home/nginx/domains/testdomain.com/public
    vhost log files directory is /home/nginx/domains/testdomain.com/log
    

    Code (Text):
    -------------------------------------------------------------
    Current vhost listing at: /usr/local/nginx/conf/conf.d/
                           
    Mar 15  06:23   846    ssl.conf
    Mar 15  06:23   1.1K   demodomain.com.conf
    Mar 15  06:34   1.6K   virtual.conf
    Mar 15  18:46   2.2K   testdomain.com.conf
    
    -------------------------------------------------------------
    Commands to remove testdomain.com
    
    pure-pw userdel ftp1
     rm -rf /usr/local/nginx/conf/conf.d/testdomain.com.conf
     rm -rf /usr/local/nginx/conf/conf.d/testdomain.com.ssl.conf
     rm -rf /usr/local/nginx/conf/ssl/testdomain.com/testdomain.com.crt
     rm -rf /usr/local/nginx/conf/ssl/testdomain.com/testdomain.com.key
     rm -rf /usr/local/nginx/conf/ssl/testdomain.com/testdomain.com.csr
     rm -rf /usr/local/nginx/conf/ssl/testdomain.com
     rm -rf /home/nginx/domains/testdomain.com
     service nginx restart
    -------------------------------------------------------------
    vhost for testdomain.com setup successfully
    testdomain.com setup info log saved at: 
    /root/centminlogs/centminmod_1.2.3-eva2000.09.004_150317-184609_nginx_addvhost.log
    -------------------------------------------------------------
    

    it auto creates a log of the entire process at /root/centminlogs/centminmod_1.2.3-eva2000.09.004_150317-184609_nginx_addvhost.log as well

    then login via FTP ensuring to read Pure-FTPD Virtual FTP Users - CentminMod.com LEMP Nginx web stack for CentOS and you need to set your FTP client to use FTP explicit SSL mode and enable and check Passive connections (PASV) and connect via your server's ip address for hostname and use FTP port 21 (not actually used in PASV mode with FTP TLS/SSL)
     
  3. eva2000

    eva2000 Administrator Staff Member

    30,178
    6,786
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,139
    Local Time:
    10:39 AM
    Nginx 1.13.x
    MariaDB 5.5
    You can't create a master ftp user, pure-ftpd virtual ftp is per nginx vhost site only. If you want to just upload yourself, you can use sftp and root user paying attention to step 2 in getting started guide for chown nginx user/group permissions after uploading or use sftp root user and backup-perm.sh tool in a cronjob https://community.centminmod.com/th...kup-restore-file-directory-permissions.10633/
     
  4. Fabio19

    Fabio19 New Member

    5
    1
    3
    Apr 13, 2017
    Ratings:
    +2
    Local Time:
    2:39 AM
    Hi Akshat, are you following these steps for 6 Week Affiliate Mastery Challenge ??
     
  5. eva2000

    eva2000 Administrator Staff Member

    30,178
    6,786
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,139
    Local Time:
    10:39 AM
    Nginx 1.13.x
    MariaDB 5.5
    ???
     
  6. Fabio19

    Fabio19 New Member

    5
    1
    3
    Apr 13, 2017
    Ratings:
    +2
    Local Time:
    2:39 AM
    • Informative Informative x 1
  7. eva2000

    eva2000 Administrator Staff Member

    30,178
    6,786
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,139
    Local Time:
    10:39 AM
    Nginx 1.13.x
    MariaDB 5.5
    I see