Results 1 to 3 of 3

Thread: chroot environment

  1. #1
    Join Date
    Nov 2009
    Location
    Uruguay
    Posts
    737

    Default chroot environment

    Hi, I'm set up a little chroot jail with bash, cp, ls, pwd, mv and rm, I
    also edit the chrooted group and passwd files and remove all users leaving
    only one, but when I type chroot jail_directory it always login as root, how
    can I set it to login as the chroot user previously defined?

    Thanks

  2. #2
    Join Date
    Jan 2009
    Location
    Switzerland
    Posts
    1,529

    Default Re: chroot environment

    First of all: you have to provide the required dynamic libraries for the commands within within the jail at the proper positions. Use ldd to check what is required:

    Code:
    ldd /bin/bash
            linux-gate.so.1 =>  (0xffffe000)
            libreadline.so.6 => /lib/libreadline.so.6 (0xb768d000)
            libdl.so.2 => /lib/libdl.so.2 (0xb7688000)
            libc.so.6 => /lib/libc.so.6 (0xb7528000)
            libncurses.so.5 => /lib/libncurses.so.5 (0xb74eb000)
            /lib/ld-linux.so.2 (0xb76ed000)
    Then I believe only the super-user can invoke chroot, exceptions applying for FreeBSD and Cygwin.
    Technology is 'stuff that doesn't work yet.' -- Bran Ferren

  3. #3
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    13,871
    Blog Entries
    3

    Default Re: chroot environment

    I think you need to write a little program that does a chroot(), and then does a setuid() to change to the desired user.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •