Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Chrooting vsftpd..
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Honzig
n00b
n00b


Joined: 19 May 2004
Posts: 4
Location: /home/honzig

PostPosted: Thu Feb 23, 2006 11:04 pm    Post subject: Chrooting vsftpd.. Reply with quote

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
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Fri Feb 24, 2006 7:21 am    Post subject: Reply with quote

Have you tried copying your existing passwd file?
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
Honzig
n00b
n00b


Joined: 19 May 2004
Posts: 4
Location: /home/honzig

PostPosted: Fri Feb 24, 2006 11:02 am    Post subject: Reply with quote

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
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Fri Feb 24, 2006 11:13 am    Post subject: Reply with quote

You may need to copy /etc/pam.d and /lib/security too ...
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
Honzig
n00b
n00b


Joined: 19 May 2004
Posts: 4
Location: /home/honzig

PostPosted: Fri Feb 24, 2006 11:34 am    Post subject: Reply with quote

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
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Fri Feb 24, 2006 11:56 am    Post subject: Reply with quote

Is there any reason why you want todo this? vsftpd supports user chroot anyway
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum