Defcon-1-Logo

           [Home]    [FBSD Articles]    [Scripts Corner]    [Contribute]    [Search]    [FBSD Links]    [Files]

About Us

FreeBSD Articles
  *Hardware
  *Networking
  *Security
  *Software
  *X Windows


Files / Scripts
Newbies Corner
Tech. Talk
Tips and Tricks


FreeBSD Links

Articles in other
Languages :
  *French Articles
  *Spanish Articles

Want to Help ?
 
   Click Here

Email Users5

Search:
 

 


FreeBSD Search:


 

 

Powered-By-Apache-Logo
Defcon1 Logo

 Setting up chroot for the stock FTPD
-------------------------------------

In order implement chroot into the stock ftpd in FreeBSD, you need to re-compile the ftpd source to include ftpd_internal_ls. Follow these steps and you'll be on your way to chroot'ing your users in no time!

1. Kill the inetd process
2. vi /etc/make.conf
3. Insert FTPD_INTERNAL_LS=YES at the bottom of the file
4. cd /usr/src/libexec/ftpd
5. make clean
6. make all
7. make install

You're done! Now ... to implement the chroot, you must have a /etc/ftpchroot file. This is where you mark which users/groups will be chroot'ed to their login directories. If you want to add an entire group, do so by putting a "@" in front of the group name (ie @users). If you want to add a single user, simply add their login name into the list.

Example/Explanation of the /etc/ftpchroot file
 (DO NOT COPY THE ARROWS OR EXPLANATIONS).

_______________

@users<--- Would chroot the *entire* "users" group to their respective login directories.
@temp  <--- Ditto above, this time for the "temp" group.
@group1 <--- Ditto above, this time for the "group1" group.
login1 <--- This would only chroot the user "login1" to their login directory.
login2 <--- Same as above for user "login2".
login3 <--- Same as above for user "login3".

_______________

I think you get the idea as to what is going on in the /etc/ftpchroot file.
Don't forget to restart inetd.

By: s0kett

Email Us

ghostrdr@defcon1.org

This site cannot be duplicated without permission

© 1998 - 2010 Defcon1, www.defcon1.org. Copyrights for all materials on this web site are held by the individual authors, artists, photographers or creators. Materials may not be reproduced or otherwise distributed without permission of www.defcon1.org and the content's original author.