On Tuesday 25 June 2002 01:05 pm, Anders Johansson wrote:
On Tuesday 25 June 2002 20.16, David Robertson wrote:
I would just like to be able to access my home directory on one machine from the other - mainly for backing up and file-sharing purposes. I'm afraid I don't know what services to configure and whether I need to edit certain files, such as /etc/hosts
Not by default you shouldn't have to.
There are two major ways of sharing directories: nfs and samba. nfs is easiest to set up, samba can be used with windows computers too.
With nfs, make sure you have the package nfs-utils installed, edit the file /etc/exports and insert a line like
/home 192.168.7.0/24(rw,no_root_squash)
save, then run "rcportmap start" and "rcnfsserver start".
On the other machine, run "rcportmap start", then create a directory somewhere, say /mnt/home for instance, then run
mount -t nfs ip.of.the.other.machine:/home /mnt/home
That will give you access to the exported home directory under /mnt/home.
I doubt that this is what he really wants to do, however... If you configure it like this, it *will* work, at least for a little while. However, as soon as his ISP gives him back a DHCP lease with a different address, the connection will be broken. The other problem with this setup is that you're really openning yourself up to the outside world. Having an NFS server exposed to the world is certainly a security risk. Kinda like painting a target on your back. What I'd *really* recommend is having 2 NICs in one (or, I suppose, both) of the computers. One of these would be connnected to the public internet, the other on your private LAN. Configure your gateway machine (the box with 2 NICs) to use NAT, and setup your internal network to use the private 192.168.1.0 network address. You can errect a firewall on the public interface, then, which can then block NFS, etc. With this type of arrangement, you're *much* more secure. It also simplfies things in that you only need to "nail down" one machine. The other possibility that comes to mind is to use a dummy "virtual" interface on both of the machines. Allow eth0 to be configured via DHCP, and firewall the hell out of it. Then, build a virtual network on top of the existing one: host1# ficonfig eth0:1 192.168.1.2 host2# ifconfig eth0:1 192.168.1.3 With the proper firewalling rules, I think that these virtual hosts should be able to talk to each other pretty securely without too much risk. Packets should never be routed to them from the outside world because they both have private IPs, yet your hub should move the packets between the two. Has anybody ever tried anything like this? I've long wondered how well it would work. -Nick