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

Security How can i create a user and lock him on public folder?

Discussion in 'System Administration' started by pamamolf, Feb 19, 2021 at 9:15 AM.

  1. pamamolf

    pamamolf Premium Member Premium Member

    3,911
    391
    83
    May 31, 2014
    Ratings:
    +760
    Local Time:
    1:11 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    Hello

    How can i create a user and lock him on public folder on Centminmod?

    Thank you
     
  2. eva2000

    eva2000 Administrator Staff Member

    46,180
    10,499
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,278
    Local Time:
    9:11 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    As per FAQ item 2, Centmin Mod isn't for shared hosting ;) The official site pure-ftpd page for How to re-create Pure-FTPD user for Vhost? would probably be closest just changing top level directory from
    /home/nginx/domains/domain.com to
    /home/nginx/domains/domain.com/public in theory. Haven't done it myself as never needed to.
     
  3. pamamolf

    pamamolf Premium Member Premium Member

    3,911
    391
    83
    May 31, 2014
    Ratings:
    +760
    Local Time:
    1:11 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    Ok thanks :)

    The problem using pure-ftpd is that is very easy to escape from the domain.com folder and go to upper directories :(
     
  4. eva2000

    eva2000 Administrator Staff Member

    46,180
    10,499
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,278
    Local Time:
    9:11 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Yeah but it shouldn't be a problem as you shouldn't be doing shared hosting as Centmin Mod isn't made for such and you only can go up to so far. Centmin Mod is made for own usage or by trusted users only.
     
  5. Jon Snow

    Jon Snow Active Member

    608
    101
    43
    Jun 30, 2017
    Ratings:
    +159
    Local Time:
    7:11 PM
    Nginx 1.13.9
    MariaDB 10.1.31
    There have been some really old posts from you about adding jailing in the future. Are those plans cancelled or is it something you're still interested in adding in at some point?
     
  6. eva2000

    eva2000 Administrator Staff Member

    46,180
    10,499
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,278
    Local Time:
    9:11 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Plans are way way into the future and would need a lot of testing and would be after 123.09beta01 comes out of beta to stable and well that is ever moving goal post which is mainly held up by not enough free time to work on 123.09 stable's documentation and full centminmod.com site redo/update. I only work on Centmin Mod in my spare time as my paid work takes priority :)

    edit: yup been a while since I posted an example of jailed user isolated Centmin Mod proposed method at Previews - Jailed / chrooted SFTP & SSH user Nginx vhost menu