Penguin
Note: You are viewing an old revision of this page. View the current version.

Syslog inside your chroot

I had a few issues getting syslog to work -

  1. In debian, the start-stop-daemon program used to start syslog finds the existing syslog running (ie the one outside the chroot) and won't start another one. I fixed this by changing a line in /etc/init.d/sysklogd from "start-stop-daemon --start --quiet --exec $binpath -- $SYSLOGD" to simply "$binpath $SYSLOGD"
  2. make sure you have all the device files it needs - eg /dev/log and /dev/console
  3. syslog wouldn't open any output log files until I copied /etc/services and restarted it - otherwise it doesn't know what port it should listen on...

SSH

There is a patchset for ssh to allow you to chroot specific users. If you just use a normal chroot and normal ssh instead, and you get errors like

sshd[1234]: error: openpty: No such file or directory

or

error: session_pty_req: session 0 alloc failed

then you are missing /dev/ptmx. Try "mknod /dev/ptmx c 5 2". -- Also see chroot(8)