[scponly] chroot question

nightowl nightowl at uk2.net
Thu Sep 11 16:36:42 EDT 2003


Thanks again for your help. I've never been this close :)

I have indeed found the file with 'ldd' and copied it to the dir. FYI,
name was the same. Got an error message of other missing files for scp
but with ldd, I solved that problem and copied all necessary files to
my chroot dir.

Got following error. I copied /etc/passwd to
/home/mytestuser/etc/passwd, but error is still there ... also after
copying /etc/group to the chroot dir. Any idea ???

# scp /root/scponly-3.8/INSTALL mytestuser at localhost:
mytestuser at localhost's password:
[5357]: chrooted binary in place, will chroot()
[5357]: 3 arguments in total.
[5357]:         arg 0 is scponlyc
[5357]:         arg 1 is -c
[5357]:         arg 2 is scp -t .
[5357]: opened log at LOG_AUTHPRIV, opts 0x00000029
[5357]: retrieved home directory of "/home/mytestuser" for user "mytestuser"
[5357]: chrooting to dir: "/home/mytestuser"
[5357]: setting uid to 507
[5357]: processing request: "scp -t ."
[5357]: running: /usr/bin/scp -t . (username: mytestuser(507), IP/port: 127.0.0.1 58722 22)
unknown user 507
lost connection

etc/passwd file currently looks like this (but also tried with full
path to home-dir)...

root:x:0:0:root:/root:/bin/bash
mytestuser:x:507:511::/:/usr/local/sbin/scponlyc

And I also tried when copying scponlyc to the
/home/mytestuser/usr.../scponlyc dir

Mind: this all works fine without the chroot...


RL> You probably need to find your dynamic-loader lib which might simply be named differntly.

RL> For example on one of our Suse boxes its named like this:
RL> -rwxr-xr-x    1 root     root        94543 Sep 20  2001 /lib/ld-2.2.4.so
RL> lrwxrwxrwx    1 root     root           11 Feb 18  2002 /lib/ld-linux.so.2 -> ld-2.2.4.so

RL> Now that you found your libc you can use
shell>> ldd /lib/libc.so.6
RL>          /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

RL> To find out the libs it needs, so in my case it's /lib/ld-linux.so.2

RL> Best regards



More information about the scponly mailing list