Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

For this example, I am using Vsftpd, as it is the default FTP client distributed with RedHat, however these instructions should apply to most FTP server applications.

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 newley 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 

Edit /etc/vsftpd/vsftpd.conf file and make sure 'local_enable=YES' is uncommented.

Restart the vsftpd service.

#/etc/init.d/vsftpd restart 
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.