View previous topic :: View next topic |
Author |
Message |
Honzig n00b
Joined: 19 May 2004 Posts: 4 Location: /home/honzig
|
Posted: Thu Feb 23, 2006 11:04 pm Post subject: Chrooting vsftpd.. |
|
|
Hi,
I'm trying to chroot vsftpd (not users, but the service), but it still doesn't work.
This is what I did and what I get:
Code: |
schizo ~ # mkdir /chroot ; cd /chroot
schizo chroot # mkdir -p usr/sbin
schizo chroot # cp /usr/sbin/vsftpd usr/sbin/
schizo chroot # ldd /usr/sbin/vsftpd
linux-gate.so.1 => (0xffffe000)
libwrap.so.0 => /lib/libwrap.so.0 (0xb7fb5000)
libnsl.so.1 => /lib/libnsl.so.1 (0xb7f9f000)
libpam.so.0 => /lib/libpam.so.0 (0xb7f96000)
libdl.so.2 => /lib/libdl.so.2 (0xb7f92000)
libresolv.so.2 => /lib/libresolv.so.2 (0xb7f7e000)
libutil.so.1 => /lib/libutil.so.1 (0xb7f7a000)
libssl.so.0.9.7 => /usr/lib/libssl.so.0.9.7 (0xb7f49000)
libcrypto.so.0.9.7 => /usr/lib/libcrypto.so.0.9.7 (0xb7e46000)
libc.so.6 => /lib/libc.so.6 (0xb7d2e000)
/lib/ld-linux.so.2 (0xb7fc7000)
schizo chroot # mkdir lib usr/lib
schizo chroot # cp /lib/libwrap.so.0 /lib/libnsl.so.1 /lib/libpam.so.0 /lib/libdl.so.2 /lib/libresolv.so.2 /lib/libutil.so.1 /lib/libc.so.6 /lib/ld-linux.so.2 lib/
schizo chroot # cp /usr/lib/libssl.so.0.9.7 /usr/lib/libcrypto.so.0.9.7 usr/lib/
schizo chroot # mkdir -p etc/vsftpd
schizo chroot # cp /etc/vsftpd/* etc/vsftpd/
schizo chroot # mkdir -p var/log
schizo chroot # mkdir -p usr/share/vsftpd/empty
schizo chroot # grep -e honzig -e nobody /etc/passwd > etc/passwd
schizo chroot # grep -e users -e nobody /etc/group > etc/group
schizo chroot # chroot /chroot /usr/sbin/vsftpd
honzig@schizo ~ $ lftp
:~> debug
:~> open honzig@localhost
Password:
---- Resolving host address...
---- 1 address found
honzig@localhost:~> ls
---- Connecting to localhost (127.0.0.1) port 21
<--- 500 OOPS: cannot locate user entry:nobody
---> USER honzig
**** control-socket: Connection reset by peer
---- Closing control socket
Interrupt
|
I used Google, but didn't find solution. I found something about adding 'nobody' to /chroot/etc/passwd, but I've got 'nobody' there...
Thanks for any reply... _________________ Beauty is in the Eye of the Beholder... |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
Honzig n00b
Joined: 19 May 2004 Posts: 4 Location: /home/honzig
|
Posted: Fri Feb 24, 2006 11:02 am Post subject: |
|
|
UberLord wrote: | Have you tried copying your existing passwd file? |
Yup, I've tried to copy /etc/passwd as well as /etc/group to my /chroot/etc. But still I'm getting the same error. _________________ Beauty is in the Eye of the Beholder... |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
Honzig n00b
Joined: 19 May 2004 Posts: 4 Location: /home/honzig
|
Posted: Fri Feb 24, 2006 11:34 am Post subject: |
|
|
UberLord wrote: | You may need to copy /etc/pam.d and /lib/security too ... |
Still the same
I don't understand that. I get "500 OOPS: cannot locate user entry:nobody" even if I've got "nobody" in /chroot/etc/passwd.. _________________ Beauty is in the Eye of the Beholder... |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
|