0

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.

user1437328
  • 15,546
  • 9
  • 34
  • 44

2 Answers2

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