Find the answer to your Linux question:
Results 1 to 5 of 5
Hi all I have setup a chroot jail with all the required utilities and want the user to be able to create and mount a loopback device. The block loop ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2005
    Location
    Scotland
    Posts
    6

    chroot - creating loopback device


    Hi all

    I have setup a chroot jail with all the required utilities and want the user to be able to create and mount a loopback device. The block loop device is correct and all needed commands etc are in place (as far as I know)

    I try the following:

    $ losetup /dev/loop0 /home/jaileduser/data.crypt
    memlock: Cannot allocate memory
    Couldn't lock into memory, exiting.

    So I check the memory allocation
    $ ulimit -l
    32

    so I try:
    $ulimit -l unlimited

    but get the error:
    ulimit: max locked memory: cannot modify limit: Operation not permitted

    I guess to change the memlock value you need to be root but how can i modify this value for each chroot user or am I being mislead by the error and have forgotted something that I need to have this setup work?

    Thanks in advance for any help

  2. #2
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    You can set ulimit to unlimited in /etc/profile for it to be global, but you'll need to run:
    Code:
    . /etc/profile
    for the changes to take effect. Or did I misinterpret your question?

  3. #3
    Just Joined!
    Join Date
    Dec 2005
    Location
    Scotland
    Posts
    6
    Quote Originally Posted by lakerdonald
    You can set ulimit to unlimited in /etc/profile for it to be global, but you'll need to run:
    Code:
    . /etc/profile
    for the changes to take effect. Or did I misinterpret your question?
    Thanks!!
    If I set it unlimited there then I can set per user in .bashrc

  4. #4
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    Yeah.

  5. #5
    Just Joined!
    Join Date
    Dec 2005
    Location
    Scotland
    Posts
    6
    Quote Originally Posted by lakerdonald
    Yeah.
    Cheers lakerdonald - that worked

Posting Permissions

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