On Fri, May 17, 2002 at 11:43:54AM +0700, Adrian Soetanto wrote: > BTW, apa sih gunanya file nsswitch.conf, saya sudah baca man-nya tapi kok > masih kurang jelas ?
nsswitch.conf dipakai sebagai rujukan program-program yang menggunakan library call untuk memanggil rutin-rutin yang berkaitan dengan nameservices misalnya dns, services, passwd, group dll. tentunya tergantung programnya sengaja dibuat perlu nsswitch.conf atau tidak. contoh libwrap, ada yang punya option untuk compiled in, sehingga /etc/host.allow,deny bisa dipakai, kalau tidak diinclude, ya otomatis host.allow,deny diabaikan. kira-kira begitu. > Apakah punya anda bisa menjalankan "$ telnet hostname" dengan benar ? > Saya juga mau tanya gimana caranya supaya kita tetap bisa pakai ftp dalam > keadaan ter-chroot, apakah ftp server juga harus dijalankan di chroot dir? sorry, mailnya jadi panjang :-) [root@krapu /jail]# pwd /jail [root@krapu /jail]# ls -l etc total 36 -rw-r--r-- 1 root root 33 Jun 21 2001 fstab -rw-r--r-- 1 root root 27 May 17 16:58 host.conf -rw-r--r-- 1 root root 22 May 17 17:00 hosts -rw-r--r-- 1 root root 280 May 17 17:01 nsswitch.conf -rw-r--r-- 1 root root 944 Jun 21 2001 passwd -rw-r--r-- 1 root root 40 May 17 16:54 resolv.conf -rw-r--r-- 1 root root 11349 May 17 17:00 services [root@krapu /jail]# ls -l lib total 2292 -rwxr-xr-x 1 root root 91608 Jun 21 2001 ld-linux.so.2 -rwxr-xr-x 1 root root 1186220 Jun 21 2001 libc.so.6 -rwxr-xr-x 1 root root 367719 May 17 16:55 libnsl.so.1 -rwxr-xr-x 1 root root 77677 May 17 16:56 libnss_dns.so.2 -rwxr-xr-x 1 root root 242320 May 17 16:59 libnss_files.so.2 -r-xr-xr-x 1 root root 44963 Jun 21 2001 libproc.so.2.0.7 -rwxr-xr-x 1 root root 231844 May 17 16:57 libresolv.so.2 -rwxr-xr-x 1 root root 12224 Jun 21 2001 libtermcap.so.2 -rwxr-xr-x 1 root root 52467 May 17 16:53 libutil.so.1 [root@krapu /jail]# ls -l usr/lib total 264 -rwxr-xr-x 1 root root 262884 May 17 16:54 libncurses.so.4 [root@krapu /jail]# chrootuid /jail adi telnet telnet> open www.playboy.com 80 Trying 209.247.228.201... Connected to www.phat.playboy.com. Escape character is '^]'. HEAD / HTTP/1.0 HTTP/1.1 302 Moved Temporarily Server: Netscape-Enterprise/3.6 SP3 Date: Fri, 17 May 2002 10:04:13 GMT Set-Cookie: dest=http://63.210.100.11/; domain=.playboy.com; path=/ Location: http://www.playboy.com/zmega.html Connection: close Connection closed by foreign host. Saya perlu meletakkan libncurses.so.4 di /jail/usr/lib karena telnet client di tempat saya butuh library tsb. libnss* adalah library yang diperlukan oleh routine yang, salah satunya, merujuk ke nsswitch.conf. nameserver point ke 127.0.0.1 (local). Kalau saran saya, sebaiknya utils yang anda letakkan di /jail compiled statically, supaya tidak perlu mengcopy semua libs yang diperlukan di chroot jail. Contoh saya cuman quick and dirty saja, berhubung males recompile :-) Salam, P.Y. Adi Prasaja -- Utk berhenti langganan, kirim email ke [EMAIL PROTECTED] Informasi arsip di http://www.linux.or.id/milis.php3