I have a simple sandbox program which runs a command as user "nobody" in a chroot jail. It sets resource limits with setrlimit, changes the user id with setuid, changes the root dir with chroot, and then calls exec to execute the command given as command line parameters. It is of course a setuid root program so that the call to chroot will work. FWIW, this is on a 64-bit machine running the latest Fedora.
It works fine when running as root; I can do things like:
(there is of course a copy of /usr/bin/printenv inside /myjail) and the environment outside the sandbox is exactly the same as inside.
Running it as a normal user, the environment outside the sandbox contains FOO, LD_LIBRARY_PATH, the modified PATH, and other things such as USER, HOME and NLSPATH. Inside the sandbox the environment is the same except that LD_LIBRARY_PATH and NLSPATH are missing!
I cannot for the life of me see why it should victimise these two variables and yet leave the rest of the environment. Can anyone help explain this puzzling behaviour?
Thanks for your help. I don't see why it should do this, but... c'est la vie.
The real problem is that I'm trying to run Java inside the sandbox and it moans that it can't locate libjli.so. The only way I know around this is to set LD_LIBRARY_PATH. Can anyone suggest a workaround?
However, there seems to be a problem with the design of the Java linker/loader, which uses LD_LIBRARY_PATH to set the java.library.path system property.
On Windows it uses PATH for this. And you can't redefine java.library.path using -D on the command line.
Googling elsewhere I found this comment: "For linux you set environment variable LD_LIBRARY_PATH, for windows you set PATH. IMHO the jdk should have added the value of java.library.path to the search path of the linker loader." What a mess!
The same, but with libjli.so not found. Running java inside the jail gives me "java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory". I modified my sandbox to copy the value of LD_LIBRARY_SANDBOX to LD_LIBRARY_PATH, and then it works if LD_LIBRARY_SANDBOX is set. So dunno why, but it seems it is needed.
Hi
I need a specific user to be able to sftp to a server and get files from a specific location. The location is not the users home dir, i don't want the user to be able to view anything else apart from the files in that area.
e.g ftp file are is - /logging/phplogs
e.g user home is... (1 Reply)
I decided to try creating a chroot environment with a BT5r2 iso file. I'm just wanting to run Backtrack from inside Debian without having to reboot into my other partition or use vmware.
I found some documentation on how to do this with BT4 at this link:
... (0 Replies)
Firstly Hi everyone :)
I setup SFTP and SSH jail using this tutorial:
http://www.howtoforge.com/chrooted-ssh-sftp-tutorial-debian-lenny
SFTP jail works however now when I try to SSH it accepts my password and then just goes to a blank screen. Type any command and the shell session is... (11 Replies)
It writes in Section 9.3 in Unix Network programming about SCTP:
"The sctp_bindx call can be used on a bound or unbound socket."
And then it writes:
"The port number in all the socket address structures must be the same and must match any port number that is already bound; if it doesn't, then... (0 Replies)
I was reading an article on how it is very important to setup a chroot jail to run bind. I can follow what the article says but one thing I am unclear about is now on system boot the BIND process in the chroot jail will start since it the owner will no longer be root but some other user. Can... (1 Reply)
Here is "escape puzzle" from real life task:
Conditions:
We need to create an alias which will
Save current directory path
Will ssh to particular server
Then will cd to saved path (it's mounted via NFS)
Then will find all files with name patter as "All*.bld" and run particular editor... (0 Replies)
Hi!!
I'm currently running AIX 4.3.3 and i'm trying to setup a chroot environment for the users who use SFTP, i spend a lot time SFTW but i can't make it work.
I got openssh3.9p1 whit the chroot patch.
Any help is greatly appreciated. (0 Replies)