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

Re: other chroot things



>>  in a chroot environment with a local passwd and shadow and group files,
>>  I cannot use users. Eg, in the chrooted bash, 'ls -l' returns 0 0 for
>>  root.root files, 8.8 for mail.mail files... so my chrooted copy of
>>  sendmail freezes.  It seems that the local passwd isn't there...
>It seems that ls doesn't use pam. (see ldd, and also experiments show this.)
>For me ls shows numbers, when /etc/passwd|group files are not 
>present. Are you sure your copies are at the right place? (no 
>symlinks of course)

 Mhhh... 
let's try:

# chroot /var/users/
# ls -la /etc

drwxr-xr-x    3 0        0            4096 Oct  5 14:44 .
drwxr-xr-x   10 0        0            4096 Oct  5 14:37 ..
-rw-r--r--    1 0        8              33 Oct  2 13:24 group
drwxr-sr-x    3 8        8            4096 Oct  2 13:07 mail
-rw-r--r--    1 0        8             230 Oct  3 15:52 passwd
-rw-r-----    1 0        0             207 Oct  5 14:29 shadow

# cat /etc/passwd 

root::0:0:root:/root:/bin/bash
mail::8:8:mail:/var/spool/mail:/bin/bash
pippo::100:100::/home/pippo:/bin/bash


The chrooted directory tree is: 

 /var/users/   :

drwxr-xr-x    2 root     root         4096 Oct  5 16:39 bin
drwxr-xr-x    3 root     root         4096 Oct  5 16:40 etc
drwxr-xr-x    3 root     root         4096 Oct  3 17:06 home
drwxr-xr-x    2 root     root         4096 Oct  2 15:18 lib
drwxr-xr-x    2 root     root         4096 Oct  5 16:37 root
drwxr-xr-x    2 root     root         4096 Oct  5 16:37 tmp
drwxr-xr-x    4 root     root         4096 Oct  3 17:11 usr
drwxr-xr-x    5 root     root         4096 Oct  2 15:29 var

 /var/users/etc/ :

drwxr-xr-x    3 root     root         4096 Oct  5 16:40 .
drwxr-xr-x   10 root     root         4096 Oct  5 16:37 ..
-rw-r--r--    1 root     mail           33 Oct  2 15:24 group
drwxr-sr-x    3 mail     mail         4096 Oct  2 15:07 mail
-rw-r--r--    1 root     mail          230 Oct  3 17:52 passwd
-rw-r-----    1 root     root          207 Oct  5 16:29 shadow

/var/users/bin/ :

-rwxr-xr-x    1 root     root       407356 Oct  5 16:39 bash
-rwxr-xr-x    2 root     root         9488 Sep 23 00:42 cat
-rwxr-xr-x    2 root     root        18044 Aug 28 12:30 chown
-rwxr-xr-x    1 root     root        43932 Oct  5 16:39 ls




Thanks, Marco



Reply to: