I'm using Jailkit. Is it possible to execute a command inside the jail and get the output (from outside) ? I did a lot of digging in the docs but unable to find anything.
Asked
Active
Viewed 1,286 times
0
-
1What you're trying to accomplish would defeat the purpose of `chroot`. – devnull May 23 '13 at 07:10
-
with basic `chroot` program, that is possible, right ? – user1437328 May 23 '13 at 09:26
2 Answers
0
If you wanted to put an impact outside chroot jail, by executing command inside chroot jail, that's not possible.

rakib_
- 136,911
- 4
- 20
- 26
-
/opt/jail , isn't your jailed root directory? Command impact will be on your 'special root directory'. Not, outside of that. :) – rakib_ May 23 '13 at 09:35
-
it is the jailed directory, yes. I want to execute a command inside (from outside) and get the output. – user1437328 May 23 '13 at 09:37
-
I then misunderstood your question. But, on my answer I mentioned that if you wants to put impact outside. It appeared confusing :-/ – rakib_ May 23 '13 at 09:39
0
If you want to write the output of your jailed command in a non jailed subdirectory you may use the mount command with the option --bind. For example if you want your jailed command to write a file in the non-jailed subdirectory /var/xxx, you should do:
mkdir /jail/home/myuser/jailed
mount --bind /var/xxx /jail/home/myuser/jailed
Of course, the subdirectory /var/xxx must have write permissions for the user.

Jdamian
- 3,015
- 2
- 17
- 22