Go Back   MacRumors Forums > Apple Systems and Services > OS X > Mac OS X Server, Xserve, and Networking

Reply
 
Thread Tools Search this Thread Display Modes
Old Mar 6, 2013, 03:46 PM   #1
marcusg
macrumors newbie
 
Join Date: Sep 2005
Setting FTP chroot directory

I'm trying to set up FTP on a Mac Mini (Mountain Lion, non-server version). I'm trying to chroot a user to another directory than the user's home directory. Let's call him aaron, homedir = /Users/aaron and desiered chroot upon ftp-login = /some/other/dir.

- I've added aaron to /etc/ftpchroot
- I've added the following line to /etc/ftpd.conf
- - chroot aaron /some/other/dir

As far as I can understand, that should put aaron in /some/other/dir. But when loggin in, aaron is chrooted in /Users/aaron! Why? Can't [pathformat] be a normal path (see https://developer.apple.com/library/...an/5/ftpd.conf )?
marcusg is offline   0 Reply With Quote
Old Mar 6, 2013, 06:44 PM   #2
assembled
macrumors regular
 
Join Date: Jan 2009
Location: London
from here https://developer.apple.com/library/...an/5/ftpchroot

The file /private/etc/ftpchroot is used to determine which users will have their session's root directory changed (using chroot(2)), either to the directory specified in the ftpd.conf(5) chroot directive (if set), or to the home directory of the user. If the file does not exist, the root directory change is not performed.
assembled is offline   0 Reply With Quote
Old Mar 7, 2013, 08:26 AM   #3
HenryAZ
macrumors regular
 
Join Date: Jan 2010
Location: South Congress AZ
Quote:
Originally Posted by marcusg View Post
- I've added the following line to /etc/ftpd.conf
- - chroot aaron /some/other/dir
Shouldn't the second word be a class keyword, rather than the user's name?
HenryAZ is offline   0 Reply With Quote
Old Mar 7, 2013, 02:38 PM   #4
marcusg
Thread Starter
macrumors newbie
 
Join Date: Sep 2005
Thanks both of you! I hadn't fully understood the usage of class. You made me study the manual a little bit more and now i nailed it! I added "aaron allow myclass" to ftpusers and modified ftpd.conf to contain "chroot my class /some/other/dir". I also removed the entry in ftpchroot.

... and (shame on me) after copying the line from ftp.conf to ftpd.conf (apparently I made a typo when opening the file in the first place!) it all worked perfect!
marcusg is offline   1 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > OS X > Mac OS X Server, Xserve, and Networking

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
copy a directory using bash - how to do it? error: is a directory (not copied). cupboy1 OS X 10.8 Mountain Lion 0 Mar 23, 2014 09:50 PM
Method for SSH/CHROOT Jails on OSX? AmestrisXServe Mac OS X Server, Xserve, and Networking 0 Mar 14, 2014 03:44 PM
How can I chroot sftp-only users into a directory different from their homes? carlosribas Mac OS X Server, Xserve, and Networking 1 Sep 3, 2013 01:58 PM
Setting up my Maya directory to point to my Creative Cloud folder Jessica Lares Design and Graphics 5 May 8, 2013 03:23 PM
Java Directory HELP! ehasen Mac Basics and Help 4 Oct 26, 2012 02:34 PM

Forum Jump

All times are GMT -5. The time now is 10:08 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC