Ubuntu chroot “No such file or directory”

Posted by Paris on Ask Ubuntu See other posts from Ask Ubuntu or by Paris
Published on 2011-01-28T12:27:25Z Indexed on 2011/01/29 15:32 UTC
Read the original article Hit count: 274

Hi there. I hace a web application where I create some folders on my server and put executables there. Then I try to wun them with chroot but I get a message that access is denied there. I tried chroot -r 777 blah blah.... and then I get a message that the folder or the file that I call (sudo chroot mydirectory myfile_inside_Mydirectory) does not exist. This happens only when I call chroot on folders created by the web server. My web application is in php and I use:

shell_exec("cp -R /var/www/comp/prison/bin $dir");

shell_exec("cp -R /var/www/comp/prison/lib $dir");

shell_exec("cp /var/www/janitor.out $dir/janitor.out");

shell_exec("sudo chmod -R 777 $dir");

$process = proc_open("sudo chroot $dir janitor.out", $descriptorspec, $pipes);

sudo does not need password.

© Ask Ubuntu or respective owner

Related posts about permissions

Related posts about directory