From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1899 Path: news.gmane.org!not-for-mail From: David Miller Newsgroups: gmane.comp.sysutils.supervision.general Subject: chpst -u -/ "unable to get password/group file entry" Date: Mon, 4 Aug 2008 11:54:15 -0500 Message-ID: <20080804165415.GA7030@pretender.frop.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1217868866 15649 80.91.229.12 (4 Aug 2008 16:54:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 Aug 2008 16:54:26 +0000 (UTC) To: supervision@list.skarnet.org Original-X-From: supervision-return-2134-gcsg-supervision=m.gmane.org@list.skarnet.org Mon Aug 04 18:55:17 2008 Return-path: Envelope-to: gcsg-supervision@gmane.org Original-Received: from antah.skarnet.org ([212.85.147.14]) by lo.gmane.org with smtp (Exim 4.50) id 1KQ3L1-0007S7-BX for gcsg-supervision@gmane.org; Mon, 04 Aug 2008 18:55:15 +0200 Original-Received: (qmail 2838 invoked by uid 76); 4 Aug 2008 16:54:39 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Archive: Original-Received: (qmail 2823 invoked from network); 4 Aug 2008 16:54:38 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=frop.net; b=EWmgjG5ZlzO+fYm2yvKA/KFCyTDtC1hNYpDDL3ZqcEypgNJs9XOr7/LU1pIoapFCGg0ShxNIPpSGim1+cpm/YkVfAip5M4esGPEwevDBZoRt2TnDQbh2BRfrFLLQpxB1gysdTkerLID/4KaeUFUIQBhLWC7Dpn0gR57WpmslEtU= ; Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1899 Archived-At: When I try to combine -u and -/ I get the error: chpst: fatal: unable to get password/group file entry: file does not exist At first I thought that it might need the passwd and group file inside the chroot but even when I copy them over chpst still fails. I would imagine that chpst can read the passwd/group file before switching into the jail. Specifying the uid and gid with -u :uid:gid does work as expected. Also using -u 'username' without -/ works fine. Heres a transcript to show what I mean, am I doing something wrong? I would like to use -u username so I don't have to lookup the uid. Thanks! root@desktop:/home/dave# ls -RF chroot/ chroot/: lib/ ls* chroot/lib: ld-linux.so.2* libattr.so.1* libpthread.so.0* libacl.so.1* libc.so.6* librt.so.1* root@desktop:/home/dave# chpst -u dave -/ chroot/ /ls chpst: fatal: unable to get password/group file entry: file does not exist root@desktop:/home/dave# grep dave /etc/passwd dave:x:1000:100:David Miller,,,:/home/dave:/bin/bash root@desktop:/home/dave# mkdir chroot/etc root@desktop:/home/dave# cp /etc/passwd /etc/group chroot/etc root@desktop:/home/dave# chpst -u dave -/ chroot/ /ls chpst: fatal: unable to get password/group file entry: file does not exist root@desktop:/home/dave# rm -r chroot/etc/ root@desktop:/home/dave# chpst -u :1000:100 -/ chroot/ /ls lib ls