Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Sep 2004 15:51:04 -0000
From:      Tony Landells <ahl@austclear.com.au>
To:        dwbear75@gmail.com
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: chroot
Message-ID:  <200207190256.MAA00937@tungsten.austclear.com.au>
In-Reply-To: Message from Michael Sharp <freebsd@ec.rr.com> "of Thu, 18 Jul 2002 22:22:59 -0400." <1085.192.168.1.4.1027045379.squirrel@webmail.probsd.ws>

next in thread | previous in thread | raw e-mail | index | archive | help
How very interesting...

For a start, you can't copy devices with "cp"--you need something
smarter like "tar", "cpio", ...  Pretty much anything that could
be used for backups should understand the niceties of copying a
device.  As an alternative you could use "mknod" to create them.
Here is how to do it with cpio:

	cd /dev
	find null random urandom -print | cpio -pdmuv /home/chrootuser/dev/

and then compare the results with ls -l to make sure you're happy.

Specifically, using "cp" to copy /dev/null is a method of creating
a new empty file, or completely emptying out an existing file.

Secondly, are you sure you weren't connected?  If you could use
control-d to terminate the connection it looks to me like you were
connected but had no prompt.  Control-d is an "end of file" indicator;
when you give it to a shell that means "there are no more commands".
Since the sole purpose of a shell is to let you execute commands, this
results in it terminating (as it does for any program that primarily
processes input).

However "end of file" is only meaningful if it's read by something.
It doesn't generate any sort of "signal" to catch the attention of
a hung program.

Try connecting again and typing a command that should work, like
"/bin/ls /bin" or even something more basic like "set" (which is
builtin to all the shells).  If you get something, you're connected.

Tony
-- 
Tony Landells					<ahl@austclear.com.au>
Senior Network Engineer				Ph:  +61 3 9677 9319
Australian Clearing Services Pty Ltd		Fax: +61 3 9677 9355
Level 4, Rialto North Tower
525 Collins Street
Melbourne VIC 3000
Australia



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-security" in the body of the message



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