Benches macOS

7

chroot

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

Dear Wise & Powerful Masters of OS X,

7 replies

Sign in or join Beachball Help to reply.

  1. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Dear Wise & Powerful Masters of OS X,

    Does the new OS X 10.5 Lepard support chroot?

    I am porting to a new Intel Macintosh. I get data files from another entity. Just in case the user ID & password leak out of the entity, I want to limit the damage.

    In OS X 10.4 I got around this problem by installing something called pureftp. But I am hoping that this problem is fixed in 10.5.

    Sorry about the 1st post, I sneezed & hit the wrong button.

    Your humble geek,

    Kurt

  2. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Mac OS X has supported chroot for FTP for some time. At least in Tiger, and presumably earlier (I don't have any earlier systems to check).

    man chroot will give you the low-down on configuring it.

  3. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    ..."Mac OS X has supported chroot for FTP for some time."...

    That's been true on paper, but in practice, the performance of chroot has been spotty in OS X eg: broken in Jaguar, fixed in Panther,
    http://www.macosxhints.com/article.php?story=20030826060517290
    http://www.macosxhints.com/article.php?story=20031027184147105

    ...and broken again in Tiger, eg.
    http://discussions.apple.com/thread.jspa?messageID=2027963

    But as near as I could tell, it did seem to be working in Leopard, at least with some preliminary tinkering back in 10.5.0. Note that I'm far from an expert, and since it relates to a security matter, don't quote me on it, but my testing only went so far as 'cd ..', which unlike Tiger, did not let me eventually get to "/".

  4. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    The solution I use is scponly and a modified home directory, but I am running Tiger. The solution probably needs some tweaks for Leopard. Could be easy; could be hard.

    Here's a tutorial for Tiger on how to set up scponly and to chroot users. Note, also, that scponly is ready for Leopard.

    Running this on Tiger (Leopard has too many networking issues under 10.5.1), I'm guessing the modification for Leopard would be easy, but I am guessing. As a result, I can't do anything but point you at these resources and say things like "reflect the changes regarding Tiger's Netinfo in Leopard's 'Advanced Options' for user accounts" and other obvious tips.

    But if you're successful and post a write-up, I'm sure I'll have a chance to follow your advice when I finally move my server to Leopard.

    Good luck,

    msq

    Message was edited by: mistersquid

  5. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Dear Camelot,

    Opps! I forgot to check the man page%^)

    Thank you for pointing out this detail.

    Sincerly yours,

    Kurt

  6. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Dear Wise & Powerful Masters of OS X,

    After some searching I found:

    $ man ftpchroot

    As I understand the instructions, these commands should lock the user into his home directory:

    $ cd etc

    $ echo user>chroot

    But, when I test the user, I am still able to run up and down the file system tree.

    What would be the best way to get the chroot file to work in OS X 10.5?

    Your humble unix geek,

    Kurt

  7. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I'm not very knowledgeable about ftp, but I think the file to which users names should be added is "/private/etc/ftpchroot", rather than "/private/etc/chroot".

    Some other things to be careful about include the fact that the command, as written, would have to have been executed as "root" in order to write to that file, or the directory if the file didn't already exist. Also note that if the file did already exist, it would have been overwritten with just the last added user's name - i.e. with that form of the command, it would only be possible to chroot one user. Use '>>' (instead of '>') to add to the file instead of overwriting it (see 'man bash' under "Redirecting Output" and "Appending Redirected Output").