Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to create user with limited access to one folder only, example /home/user1.Like in cPanel and WHM.

How can i do it ?

share|improve this question
Access through what -- a web application? shell? sftp? ftp? file-transfer-over-nyan-cat? – David Mackintosh Jun 19 '12 at 14:39
Access through ftp – Haris Muharemović Jun 19 '12 at 15:09
up vote 4 down vote accepted

Create a FTP user group. eg: ftpaccounts

#/usr/sbin/groupadd ftpaccounts 

Add a new user to this group, and set the default path of that user to /home/user/.

#/usr/sbin/adduser -g ftpaccounts -d /home/user/ testuser 

Set a password for the newly created user.

#passwd testuser 

Set ownership of /home/user to the testuser and ftpaccounts.

#chown testuser:ftpaccounts /home/user 

Give Read/Write access to testuser and all members in ftpaccounts

#chmod 775 /home/user 
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .