Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.