jailkit-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Jailkit-users] How to Jail Python Interpreter


From: Gregory Piñero
Subject: Re: [Jailkit-users] How to Jail Python Interpreter
Date: Tue, 18 Sep 2007 17:19:48 -0400

On 9/18/07, Gregory Piñero <address@hidden> wrote:
> On 9/17/07, Gregory Piñero <address@hidden> wrote:
> > On 9/17/07, Olivier Sessink <address@hidden> wrote:
> > > you probably need a lot of extra python files as well. My systems has
> > > lots of files in /usr/lib/python2.4/ that are part of the python global
> > > libraries.
> >
> > Yeah, I ended up copying /usr/lib/python2.4 into the jail too.  Is
> > copying manually the best way, or is there a jailkit tool for this?
> >
> > >
> > > use jk_chrootlaunch to start a process inside the jail. You can use any
> > > unprivileged user, so generally it's good to create an account (but it
> > > doesn't need a shell or a home directory)
> >
>
> I tried running my python script like this:
> $ sudo jk_chrootlaunch -u jailtest -g jailtest -j
> /srv/jail_for_python/ -x /srv/jail_for_python/usr/bin/python2.4
> exec_worker.py
>
> and got this error:
> usr/bin/python2.4: can't open file 'exec_worker.py': [Errno 13]
> Permission denied
>
> exec_worker.py is owner by root and the group is root.  Which I
> figured is what I want since it resides inside the jail?

Ok, this seems to fix it:
$ sudo chown root:jailtest /srv/jail_for_python/exec_worker.py
and then setting the permission on it to: -rw-r-----

Is  that the RIGHT thing to do?

> Here's what the directory looks like
>
> /srv/jail_for_python/
>   usr/
>   etc/
>   lib/
>   exec_worker.py
>
> I also tried providing the full path to the python script like this:
> $ sudo jk_chrootlaunch -u jailtest -g jailtest -j
> /srv/jail_for_python/ -x /srv/jail_for_python/usr/bin/python2.4
> /srv/jail_for_python/exec_worker.py
>
> But it can't find it:
> usr/bin/python2.4: can't open file
> '/srv/jail_for_python/exec_worker.py': [Errno 2] No such file or
> directory
>

I'm still quite curious why this is happening too.

Thanks again for all the help.  I think I'm getting close!

-Greg




reply via email to

[Prev in Thread] Current Thread [Next in Thread]