[Top][All Lists]

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

[Jailkit-users] Screen in jailkit

From: dev
Subject: [Jailkit-users] Screen in jailkit
Date: Mon, 05 Nov 2007 18:34:07 +0100

Hello, I've been experimenting with getting screen to work in a jail created by jailkit. After two hours of experiments and consulting a "big search engine" I have been successful. I still believe my solution is neither the 'best thing' nor is it probably very secure. So without further ado, here is how to get screen working in debian 4.0r1 (minimal installation) - this may or may not work on other linux distributions: 1. Extend /etc/jailkit/jk_init.ini with:
comment = files and devices for screen
groups = tty
executables = /usr/bin/screen, /usr/bin/dircolors
paths_w_owner = /usr/share/terminfo, /dev/pts, /var/run/screen
devices = /dev/ptypa, /dev/ttypa, /dev/ptmx, /dev/null 2. Create a jail directory (or use an exisiting directory). See http://olivier.sessink.nl/jailkit/howtos_chroot_shell.html
Use the definition from 1 to extend your jail
"jk_init -v /home/jail screen" 2b. Now you could start screen, but read the next few steps
3. Start screen. The first error: "Must be connected to a terminal"
This - possibly dangerous - solution: mount devpts into the jail:
"mount -t devpts devpts /home/jail/dev/pts/" 4. The next error from screen is "Please set a terminal type". This can be circumvented by running "export TERM=xterm" in your chroot session. 5. Next up is "Directory '/var/run/screen' must have mode 777". So "chmod 777 /home/jail/var/run/screen". You are probably not logging into the chroot with the user root, so you have to correct this from outside your chroot session. 6. This is it: screen should be working inside your jail. 7. There is only one slight problem up to now: Each time you reconnect to your machine using ssh, you'd have to re-export the environment variable TERM.
You can edit /home/jail/home/${myuser}/.bashrc and add
"export TERM=xterm" to the end of that file. Now it is set each time you log into the jail. Any suggestions are very welcome.

reply via email to

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