Find this

Out of Control®

Keeping you in control

Out of Control

Services

Showcase

Domains

My Wish List

Contact

About

Information and Links

Join the fray by commenting, tracking what others have to say, or linking to it from your blog.

Information

March 28th, 2007

No Responses

Feeds and Links

Comment Feed

From This Author

Del.icio.us

Digg

Technorati

Categories

How-To

RHEL and Ensim

Other Posts

Use fuser to diagnose umount issues

A little humour

Selectively jail ftp users in virtual domains

Posted by plattapuss on March 28th, 2007

The following how to is from Chris over at Ensim.com

Have you ever wanted to give a user FTP access to their own little site on a virtual domain, but didn't because you were afraid they would snoop around your main sites files? Worry no longer. This little how-to will let you selectively 'jail' a user to their home folder on your server. By jail, we mean that the user will not be able to see any files or folders outside their own home folder on your server.

Add the line

PLAIN TEXT

CODE:

DefaultRoot ~ jailedftpusers

to /etc/proftpd.conf. You can add it right above

the 'include "/etc/proftpd/proftpd.conf.wp"' line at

the end of the file. You must now Restart proftpd with

PLAIN TEXT

CODE:

/etc/init.d/proftpd restart

If you want this hack to work on namebased sites AND IP based sites, people have suggested adding the above line to /etc/proftpd.conf inside the tags. I however, have not tried it myself.

2. For each site where you want to have jailed

ftp users, do the following:

PLAIN TEXT

CODE:

/usr/sbin/chroot /home/virtual/<domain> /usr/sbin/groupadd -g 50 -o jailedftpusers

3. For each user you wish to jail, do the

following:

PLAIN TEXT

CODE:

/usr/sbin/chroot /home/virtual/</domain><domain> /usr/sbin/usermod -G jailedftpusers <username>

That is all there is to getting selective jailed FTP users in a virtual domain on an Ensim box.

After thought: If you want to change where the user is jailed to, then one would simply need to change the path for that user in the /etc/passwd file. Haven't tried it, but seems it should work.

Reader Comments

Sorry, comments are closed.

Out of Control®

Contact

Acceptable Use Policy (AUP)

Terms of Service (ToS)

Privacy Statement

About

Unless otherwise specified, all material is copyright (c)2000-2009 Out of Control™

Out of Control® is a Registered Trademark of Out of Control enr., used under license by outofcontrol.ca./Marque déposée, utilisée sous license par outofcontrol.ca
We are moving to Expression Engine soon!