21.03.2013 Views

Problem - Kevin Tafuro

Problem - Kevin Tafuro

Problem - Kevin Tafuro

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Creating a jail is as simple as filling in a data structure with the appropriate information<br />

and calling jail( ). The same caveats that apply to chroot( ) also apply to jail( )<br />

because jail( ) calls chroot( ) internally. In particular, only the superuser may create<br />

a jail successfully.<br />

Presently, the jail configuration structure contains only four fields: version, path,<br />

hostname, and ip_number. The version field must be set to 0, and the path field is<br />

treated the same as chroot( )’s argument is. The hostname field sets the hostname of<br />

the jail; however, it is possible to change it from within the jail.<br />

The ip_number field is the IP address to which processes running within the jail are<br />

restricted. Processes within the jail will only be able to bind to this address regardless<br />

of what other IP addresses are assigned to the system. In addition, all IP traffic<br />

emanating from processes within the jail will be forced to use this address as its<br />

source.<br />

The IP address assigned to a jail must be configured on the system; typically, it<br />

should be set up as an alias rather than as the primary address for a network interface<br />

unless the network interface is dedicated to the jail. For example, a system with<br />

two network interfaces may be configured to route all traffic from processes outside<br />

the jail to one interface, and route all traffic from processes inside the jail to the<br />

other.<br />

See Also<br />

Recipe 2.12<br />

70 | Chapter 2: Access Control<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!