Re: Can't login Jailed system

2009-06-29 Thread Sam Wun
I got the following errors now:

# less jail_wwp1_console.log
ps: empty file: Invalid argument
Loading configuration files.
/etc/rc: WARNING: $hostname is not set -- see rc.conf(5).
ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib
/usr/local/lib/mysql
a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout
Creating and/or trimming log files:.
Starting syslogd.
Clearing /tmp.
Starting local daemons:.
Updating motd.
Starting sshd.
PRNG is not seeded
Starting cron.
Local package initialization:.
ps: bad namelist


THANKS
___
freebsd-jail@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-jail
To unsubscribe, send any mail to "freebsd-jail-unsubscr...@freebsd.org"


Re: Can't login Jailed system

2009-06-29 Thread Sam Wun
Apologies, I accidentally commented out the jail_dev and jail_proc
liens in the rc.conf file, wasted everyone s time.

Thanks for the  help. :D
Sam

On Tue, Jun 30, 2009 at 12:29 AM, Jon Passki wrote:
> On Mon, Jun 29, 2009 at 9:21 AM, Sam Wun wrote:
>> I got the following errors now:
>>
>> # less jail_wwp1_console.log
>> ps: empty file: Invalid argument
>> Loading configuration files.
>> /etc/rc: WARNING: $hostname is not set -- see rc.conf(5).
>> ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib
>> /usr/local/lib/mysql
>> a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout
>> Creating and/or trimming log files:.
>> Starting syslogd.
>> Clearing /tmp.
>> Starting local daemons:.
>> Updating motd.
>> Starting sshd.
>> PRNG is not seeded
>> Starting cron.
>> Local package initialization:.
>> ps: bad namelist
>
> Assuming you didn't build a kernel to exclude the random device, it
> looks like you do not have a /dev filesystem mounted for your jail.
> ssh needs some type of random device.  Try mounting a devfs in the
> path of your jail.  If you are using /etc/rc.conf for this
> information, man 5 rc.conf, look at the "jail_devfs_enable" and
> "jail__devfs_enable" variables.
>
> Jon
>
___
freebsd-jail@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-jail
To unsubscribe, send any mail to "freebsd-jail-unsubscr...@freebsd.org"


Re: Can't login Jailed system

2009-06-29 Thread Jon Passki
On Mon, Jun 29, 2009 at 9:21 AM, Sam Wun wrote:
> I got the following errors now:
>
> # less jail_wwp1_console.log
> ps: empty file: Invalid argument
> Loading configuration files.
> /etc/rc: WARNING: $hostname is not set -- see rc.conf(5).
> ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib
> /usr/local/lib/mysql
> a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout
> Creating and/or trimming log files:.
> Starting syslogd.
> Clearing /tmp.
> Starting local daemons:.
> Updating motd.
> Starting sshd.
> PRNG is not seeded
> Starting cron.
> Local package initialization:.
> ps: bad namelist

Assuming you didn't build a kernel to exclude the random device, it
looks like you do not have a /dev filesystem mounted for your jail.
ssh needs some type of random device.  Try mounting a devfs in the
path of your jail.  If you are using /etc/rc.conf for this
information, man 5 rc.conf, look at the "jail_devfs_enable" and
"jail__devfs_enable" variables.

Jon
___
freebsd-jail@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-jail
To unsubscribe, send any mail to "freebsd-jail-unsubscr...@freebsd.org"


Re: Can't login Jailed system

2009-06-29 Thread Jon Passki
(Un-CC'd freebsd-net@)

On Mon, Jun 29, 2009 at 6:29 AM, Bjoern A.
Zeeb wrote:
> On Mon, 29 Jun 2009, Sam Wun wrote:
>
>> After I login 192.168.1.242, I ended up logged in twp1 which is my host
>> system.
>> Now I am stuck. I don't know how I logged in the jailed system a month
>> ago.
>>
>> Can anyone shred some lights on me?
>
> Try to jexec 5 /bin/sh (5 is the jailID from the jls output)  and check
> with ps if sshd is running inside the jail, and check the usual things
> are up and there.

Sam, what Bjoern is alluding to is that SSH in the main system is
probably running on all IP addresses on port 22/TCP.  The jail(8) man
page has a section called "Setting up the Host Environment" which you
might want to review again.  For SSH, check out /etc/ssh/sshd_config
and look for "ListenAddress".  If it is setup for the default setting
of "#ListenAddress 0.0.0.0", then uncomment it and change that line in
your main system to be the main IP address.  Restart sshd
(/etc/rc.d/sshd restart).  You will probably have to restart your
jail's sshd instances since they probably tried to bind to their IP
address on 22/TCP unsuccessfully.  (Or, just restart all of your jails
if it's not a big concern, /etc/rc.d/jail restart.)

Hope that helps,

Jon
___
freebsd-jail@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-jail
To unsubscribe, send any mail to "freebsd-jail-unsubscr...@freebsd.org"


Re: Can't login Jailed system

2009-06-29 Thread Bjoern A. Zeeb

On Mon, 29 Jun 2009, Sam Wun wrote:

Hi,

we've got a freebsd-jail list that I am Cc:ing.



With FreeBSD 7.2Stable,
I have done this many times before.
After about a month left the "jail" behind, now when I done a
"/etc/rc.d/jail start" and ssh into it, I ended up login to the host
system.
Here is the network configuraiton of the host system and the jail system:

# ifconfig
rl0: flags=8843 metric 0 mtu 1500
   options=8
   ether 00:00:21:ef:27:f7
   media: Ethernet autoselect (100baseTX )
   status: active
rl1: flags=8802 metric 0 mtu 1500
   options=8
   ether 00:50:fc:65:78:c0
   media: Ethernet autoselect
   status: no carrier
fxp0: flags=8843 metric 0 mtu 1500
   options=8
   ether 00:13:20:65:a9:be
   inet 192.168.1.246 netmask 0xff00 broadcast 192.168.1.255
   inet 192.168.1.245 netmask 0xff00 broadcast 192.168.1.255
   inet 192.168.1.235 netmask 0xff00 broadcast 192.168.1.255
   inet 192.168.1.242 netmask 0x broadcast 192.168.1.242
   media: Ethernet autoselect (100baseTX )
   status: active
plip0: flags=108810 metric 0 mtu 1500
enc0: flags=0<> metric 0 mtu 1536
pflog0: flags=141 metric 0 mtu 33204
pfsync0: flags=0<> metric 0 mtu 1460
   syncpeer: 224.0.0.240 maxupd: 128
lo0: flags=8049 metric 0 mtu 16384
   inet6 fe80::1%lo0 prefixlen 64 scopeid 0x8
   inet6 ::1 prefixlen 128
   inet 127.0.0.1 netmask 0xff00
twp1:# jls
  JID  IP Address  Hostname  Path
5  192.168.1.242   twp5.ip6.com.au   /usr/jail2/twp5

192.168.1.242 is the jailed system,
twp1 is the host system.

After I login 192.168.1.242, I ended up logged in twp1 which is my host system.
Now I am stuck. I don't know how I logged in the jailed system a month ago.

Can anyone shred some lights on me?


Try to jexec 5 /bin/sh (5 is the jailID from the jls output)  and check
with ps if sshd is running inside the jail, and check the usual things
are up and there.


/bz

--
Bjoern A. Zeeb  The greatest risk is not taking one.
___
freebsd-jail@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-jail
To unsubscribe, send any mail to "freebsd-jail-unsubscr...@freebsd.org"