Red Hat

Duane Attaway dattaway at attaway.net
Sun Oct 27 19:55:27 CST 2002


On Sun, 27 Oct 2002, Lucas Peet wrote:

> Ho, NICE!!!  I love Linux - there's no way you could do anything nearly 
> that cool in M$ Winblows.  Ya know, maybe I'll give that a shot...I feel 
> a project coming on.  You wouldn't happen to have any documentation on 
> that - how you did that, how you set up the Ghz box, and the base Gentoo 
> box to get to that point?  I'd like that - maybe a short HowTo or 
> something would be great.

I got this idea just to see if it could be done.  The procedure was 
identical to the x86 install instructions on the gentoo home page, with 
the exception of exporting the root directory to another computer.  The 
only bottleneck limiting speed is the bandwidth between the hard drive and 
the ethernet.

We can do this in 7 easy steps.  Let me know if this doesn't work or if
any of this is inacurrate, etc... If you can stand reading my lengthy
commentary and a few notes about security, read on...

On the slow computer, you need to have a working shell functional enough
to export the root directory.  I'm sure the complete environment is
contained in most distribution installation cdroms.

1.  Give your fast box permissions to access the NFS mount.  nfsd uses the
files /etc/hosts.allow, /etc/hosts.deny, and /etc/exports.  From your slow
gentoo wannabee box, be root and add this line in /etc/hosts.allow like
this to allow the fast 192.168.1.4 box access:

ALL: 192.168.1.4

This is your security and here are a few words about it.  It will allow
these two other computers on my network complete access to all services.  
Your NFS packets will be broadcasted all over the network.  You had better
be confident of your firewall.  If your cablemodem is your firewall, be
sure your routes do not point toward it or to some gateway beyond.  If you
don't know what any of this meant, don't even try on a live network.  
Word is going around that cablemodem boxes can be cracked too.  Be
careful.  This is your root directory you are exporting.  Don't let your
box become Bin Laden's spam soapbox.

So, add the following lines in hosts.deny:

portmap:ALL
lockd:ALL
mountd:ALL
rquotad:ALL
statd:ALL

The order is accept, deny.  If some computer peeking around the internet
isn't listed in hosts.accept, it will be masked by anything matching
hosts.deny.  Since nfsd doesn't have encryption and has lousy
authentication, we shall deny all hosts that don't originate from our
network.  Your firewall is responsible for keeping packets legitimate or
this system will be compromised in a matter of hours or days.  If you have 
the time, it isn't a bad idea to learn about security and google for some 
hack kits and try and break into your system.  This may open your eyes if 
you have this on the net.

2. Now add the directory you want exported either using the exportfs 
command.  If your superdeeduper 4GHz Quad Athalon box has the address 
of 192.168.1.4, add the following line in /etc/exportfs:

/ 192.168.1.4(rw,no_root_squash)

3. You may get the nfsd services started with the command:

/etc/init.d/nfs start

This broadcasts your root directory over your network with read/write root
permissions.  Isn't this fun?  Aren't you glad these computers are on a
private network?  Good.

4. Now, let us go to our superdeeduper 4GHz Quad Athalon box where we
shall create the universe.  Open up a root shell and make a directory like
this:

mkdir gentoobox

5. now, if the address of your gentoo wannabee box is 192.168.1.5, issue
this mysterious command:

mount 192.168.1.5:/ gentoobox

6. You will suddenly see the hard drive in the gentoobox directory.  This
is where we let that hard drive take over our shell with the chroot
command.  Change into this directory:

cd gentoobox

and chroot:

chroot . bin/bash

and let's update the environment by simulating a login:

/usr/sbin/env-update   <--or similar script...

7. That's it.  Your fast processor is now cooking your gentoo system.  
Type this:

emerge world

For more reference, these following commands may help:

man exportfs




More information about the Kclug mailing list