jailkit-dev
[Top][All Lists]
Advanced

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

[Jailkit-dev] Can jk_chrootsh be used manually ?


From: Ashish Sharma
Subject: [Jailkit-dev] Can jk_chrootsh be used manually ?
Date: Thu, 11 Jul 2013 14:11:00 +0530

Hi, 

I have jailkit perfectly setup on my server.

I am trying to give web-access to the users. I have created a Terminal server ( 
http://github.com/pocha/terminal-server) using pty.js 
(https://github.com/chjj/pty.js). 

The part of code that creates a bash terminal for a user looks like 
----------
var term = pty.spawn('bash', [], {
  name: 'xterm-color',
  cols: 80,
  rows: 30,
  cwd: process.env.HOME,
  env: process.env
});
---------

By using uid & gid option of the API, I am able to launch the bash terminal as 
the user. But he is not really getting jailed. 
---------
var term = pty.spawn('bash', [], {
  name: 'xterm-color',
  cols: 80,
  rows: 30,
  uid: <uid of user>,
  gid: <gid of user>
});
----------

I am trying to 'login' a jailed user so that the bash terminal shows up with he 
being jailed. I was thinking that using '/usr/sbin/jk_chrootsh' instead of 
'bash' could solve my problem, but it did not really work for me.

I realized I do not really understand how jk_chrootsh works. Can somebody help 
me with this ?

Just to give an alternative picture, doing 'su <jailed_user>' inside terminal 
after it get spawned as root solves the problem. But if the user type 'exit', 
the user gets root access. This is an ugly hack just to explain the situation. 

Thanks
Ashish


reply via email to

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