How to limit a user to a specific directory?

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

How to limit a user to a specific directory?

Post by 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: 843
Joined: 2014/08/07 02:17:29
Location: Tucson, AZ

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

Post by 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
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

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

Post by 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.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

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

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

Post by 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

Post Reply