1

There's a plenty of advices across the Internet on how to enable DNS in chroot.

The problem is that there's no /lib/libnss* files in the Ubuntu Precise.

I've tried to copy these files from /etc/: hosts, nsswitch.conf, resolv.conf and the entire /lib directory. But DNS is still not working.

Does anyone have a recipe for the recent Ubuntu?

Pavel Koryagin
  • 255
  • 1
  • 3
  • 8

2 Answers2

0

well... there are two solutions: the first, and most simple one, is to look for the library into /lib64 if present, or eventually using locate libnss to look for it.
The other solution would be to use strace to see where is the system looking for the library and look in the main system for those libraries. :)

Alessio Periloso
  • 198
  • 2
  • 10
0

As a start, this script, once customized, should give you a basis for a chroot.

http://www.fuschlberger.net/programs/ssh-scp-sftp-chroot-jail/make_chroot_jail.sh

Just as a caveat for other readers, just read this

PHP-FPM chroot with chdir

Ben Lessani
  • 5,244
  • 17
  • 37