Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Jul 2008 20:40:05 -0400
From:      Mikhail Goriachev <mikhailg@webanoide.org>
To:        =?UTF-8?B?0JXQstCz0LXQvdC40Lkg0KjQsNC/0L7QstCw0Ls=?= <jeno.kiev@gmail.com>, freebsd-jail@freebsd.org
Subject:   Re: getpwnam: root: No such file or directory
Message-ID:  <48828965.5000802@webanoide.org>
In-Reply-To: <f1eca1b20807191455w1deddd63jb63a4ea049647b2c@mail.gmail.com>
References:  <f1eca1b20807190529i523c22bbp7f20bfc2561d11bc@mail.gmail.com>	 <488233B0.1000904@webanoide.org>	 <f1eca1b20807191319t4969901aya8c7b06c8f81c9dc@mail.gmail.com>	 <48825D18.1010001@webanoide.org> <f1eca1b20807191455w1deddd63jb63a4ea049647b2c@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?48828965.5000802>