From owner-freebsd-jail@FreeBSD.ORG Sun Jul 20 00:40:25 2008 Return-Path: Delivered-To: freebsd-jail@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E191D1065678 for ; Sun, 20 Jul 2008 00:40:25 +0000 (UTC) (envelope-from mikhailg@webanoide.org) Received: from smtp.tal.navalradio.cl (smtp.tal.navalradio.cl [201.236.67.155]) by mx1.freebsd.org (Postfix) with ESMTP id 898248FC08 for ; Sun, 20 Jul 2008 00:40:25 +0000 (UTC) (envelope-from mikhailg@webanoide.org) Received: from [172.18.64.125] ([172.18.64.125]) (authenticated bits=0) by smtp.tal.navalradio.cl (8.13.8/8.13.8) with ESMTP id m6K0bgKc090503 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 20 Jul 2008 00:37:52 GMT (envelope-from mikhailg@webanoide.org) Message-ID: <48828965.5000802@webanoide.org> Date: Sat, 19 Jul 2008 20:40:05 -0400 From: Mikhail Goriachev Organization: Webanoide User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: =?UTF-8?B?0JXQstCz0LXQvdC40Lkg0KjQsNC/0L7QstCw0Ls=?= , freebsd-jail@freebsd.org References: <488233B0.1000904@webanoide.org> <48825D18.1010001@webanoide.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: Subject: Re: getpwnam: root: No such file or directory X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2008 00:40:26 -0000 Please make sure you also reply to the list (freebsd-jail@freebsd.org). Евгений Шаповал wrote: >> As Miroslav already stated, can you show us the rc.conf of the host and the >> way you populated the jail? > > rc.conf of main os: > =========================================================== > defaultrouter="xxx.xxx.236.249" > ifconfig_fxp0="inet xxx.xxx.236.251/29" > ifconfig_fxp0_alias0="inet xxx.xxx.10.131/26" > ifconfig_lo0_alias0="inet xxx.xxx.236.253/30" > > // test jail > ifconfig_fxp0_alias0="inet xxx.xxx.10.160 netmask 255.255.255.0" ^^^^^^^^^^^ You declared ifconfig_fxp0_alias0 twice. This will cause confusion in your system. > ifconfig_fxp0_alias1="inet xxx.xxx.10.161 netmask 255.255.255.0" > [...] > > jail_enable="YES" > jail_list="test" > jail_set_hostname_allow="YES" You might want to add the following lines: jail_exec_start="/bin/sh /etc/rc" jail_exec_stop="/bin/sh /etc/rc.shutdown" > jail_test_rootdir="/usr/local/jails/test" > jail_test_hostname="test-jail.local" > jail_test_ip="xxx.xxx.10.160" > jail_test_devfs_enable="YES" > jail_test_procfs_enable="YES" > jail_test_flags="-l -U root" ^^^^^^^^^^^^^^^ The jail_test_flags is unnecessary. [...] > > I just saw that the file "/usr/local/jails/test/etc/master.passwd" is empty... > > I try add "root" user: > > open jail: > > # jail /usr/local/jails/test/ test xxx.xxx.10.160 /bin/csh > > # adduser > > I have: > > =========================================================== > Username: root > Full name: > Uid (Leave empty for default): > > Login group [root]: Login group is root. Invite root into other groups? []: > Login class [default]: > Shell (sh csh tcsh date nologin) [sh]: > Home directory [/home/root]: > > Home directory permissions (Leave empty for default): Use > password-based authentication? [yes]: > Use an empty password? (yes/no) [no]: > Use a random password? (yes/no) [no]: > Enter password: > Enter password again: > Lock out the account after creation? [no]: > Username : root > Password : ***** > Full Name : > Uid : 1001 > Class : > Groups : root > Home : /home/root > Home Mode : > Shell : /bin/sh > Locked : no > OK? (yes/no): y > pwd_mkdb: root uid should be 0 > pwd_mkdb: at line #1 > pwd_mkdb: /etc/master.passwd: Inappropriate file type or format > pw: user 'root' disappeared during update > adduser: ERROR: There was an error adding user (root). > Add another user? (yes/no): > =========================================================== You can't just add the root account. The jail/system should already come with everything. It seems like you didn't populate the jail, that is why there are many missing pieces. What steps did you take to make your jail? Regards, Mikhail. -- Mikhail Goriachev Webanoide