How to limit a user to a specific directory?

General support questions
hongtrang
Posts: 5
Joined: 2018/05/14 07:28:59

How to limit a user to a specific directory?

Postby hongtrang » 2018/05/15 15:14:08

My server running pure-fpt. I used the following command to create users and add them to the directory

Code: Select all

pure-pw useradd newuser -u newuser -g newusers -d /home/newuser/public_html
chown -R newusers:newuser /home/newuser/public_html

But this user can access other folders like /home, /etc or /var, /opt ...
So how can the user only be allowed access to the public_html directory above

Thanks!

desertcat
Posts: 337
Joined: 2014/08/07 02:17:29

Re: How to limit a user to a specific directory?

Postby desertcat » 2018/05/15 16:28:59

hongtrang wrote:My server running pure-fpt. I used the following command to create users and add them to the directory

Code: Select all

pure-pw useradd newuser -u newuser -g newusers -d /home/newuser/public_html
chown -R newusers:newuser /home/newuser/public_html

But this user can access other folders like /home, /etc or /var, /opt ...
So how can the user only be allowed access to the public_html directory above

Thanks!


Can you create a /home/newuserID and create a directory called /public_html which all users have access to, but then using chmod make directories like /home, /etc, /var, /opt, etc. and put them all under a directory called /Admin under a group called Admin that could only be accessed by a few select people (systems administrators) which is password protected. That way newusers are left in their own little ghetto, and even IF one is a hacker and can figure out where all those "missing" directories have gone s/he then has to crack a Password just to make themselves part of the Admin group. IF they can manage to do that offer them a job!!! :lol:

User avatar
TrevorH
Forum Moderator
Posts: 22590
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How to limit a user to a specific directory?

Postby TrevorH » 2018/05/15 16:32:52

We dont ship pureftp so it's not a product I am familiar with. Our ftp daemon is vsftpd. On that you can set up chroot environments that stop users from getting to places they shouldn't. I would suspect pureftp has a similar functionality - you just need to find someone who knows that package or, alternatively, read the documentation for it.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

hongtrang
Posts: 5
Joined: 2018/05/14 07:28:59

Re: How to limit a user to a specific directory?

Postby hongtrang » 2018/05/16 07:44:15

TrevorH wrote:We dont ship pureftp so it's not a product I am familiar with. Our ftp daemon is vsftpd. On that you can set up chroot environments that stop users from getting to places they shouldn't. I would suspect pureftp has a similar functionality - you just need to find someone who knows that package or, alternatively, read the documentation for it.

Thank you, me was resolve with the USERS VIRTUAL
https://download.pureftpd.org/pub/pure- ... tual-Users