View Single Post
  #1   (View Single Post)  
Old 27th May 2009
Dr_Death_UAE's Avatar
Dr_Death_UAE Dr_Death_UAE is offline
BSD Daemon
 
Join Date: Jul 2008
Posts: 9
Default chroot jail FreeBSD "su: who are you?"

Hello, i create chroot jail every thing fine but when i try to login with the jailed user with su i got:
Quote:
su: who are you?
from the logs:

Quote:
May 27 15:33:28 h4x0r sudo: r0x : TTY=ttyp0 ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/chroot /home/jail /usr/bin/su - r0x
from visudo:
Quote:
r0x ALL=NOPASSWD: /usr/sbin/chroot, /usr/bin/su - r0x
from "/home/jail/etc/passwd":
Quote:
r0x:*:1003:1003:User &:/home/r0x:/usr/local/bin/bash
from "/etc/passwd":
Quote:
r0x:*:1003:1003:User &:/home/jail/home/r0x:/bin/chroot-shell
the "chroot-shell" include:
Quote:
#!/usr/bin/env sh
/usr/local/bin/sudo /usr/sbin/chroot /home/jail /usr/bin/su - $USER "$@"
i use the same methods with linux systems it work fine, i use pwd_mkdb to update the master.passwd on the jail:
Quote:
pwd_mkdb -d /home/jail/etc/ /home/jail/etc/master.passwd
but still the same. i read that i need to use rssh as the shell instead of bash shell.
__________________
Theory is when you know all and nothing works.
Practice is when all works and nobody knows why.
In this case we have put together theory and practice: nothing works... and nobody knows why!
(Albert Einstein)
Reply With Quote