jailkit-users
[Top][All Lists]
Advanced

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

Re: [Jailkit-users] Run command as jailed user from script ran as root?


From: Olivier Sessink
Subject: Re: [Jailkit-users] Run command as jailed user from script ran as root?
Date: Thu, 28 Apr 2011 09:26:09 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8

On 04/28/2011 06:49 AM, Harn_Hua Ng wrote:
Hi,

I am new to jailkit, having just installed and configured with some success.
Things look good so far.

I'd like to run a command in the jail as the jailed user, from a script
that is run by root outside of the jail.
Normally I think this can be achieved by "su - jaileduser -c
"path/to/script/inside/jail"
but I think there are problems with this approach:

i) using su is bad?
ii) I get the following output:
su: warning: cannot change directory to /path/to/script/inside/jail:
Permission denied
/bin/bash: /path/to/script/inside/jail: Permission denied

Is there an easier way to accomplish this?
Or should I do something like setting up ssh within the jail and ssh
using the jailuser's identity into localhost to run the jaileduser's script?

I've implemented this in the development code in CVS. You can run

su testuser -c 'my jailed command'

it won't work without the quotes around the command.

Olivier


--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/



reply via email to

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