Utilizing an NFS system at home First, upon using your router to assign permanent IP addresses to each of your machines (see router manuals on how to do this, commonly through a webpage but I will not vouch for that) in my system I use the IP addresses 172.100.0.100 mhd2 (linux) 172.100.0.101 kdl1 (linux) 172.100.0.102 kdl2 (windows) 172.100.0.103 mhd1 (linux) In your /etc/hosts file add the lines 172.100.0.100 mhd2 172.100.0.101 kdl1 172.100.0.102 kdl2 172.100.0.103 mhd1 What this will do is allow your computer to recognize the alias (say mhd2) so using the line ssh mhd2 is in place of using ssh 172.100.0.100 It will make later coding more clear, and easier to implement. With this done, we continue on by looking at /etc/hosts.deny I recommend for a home network adding the line ALL:ALL This will stop all users from accessing your network. This is rather important to block potential hackers. It is not always fool-proof, but it will stop accidental abuse of your network in the least. Now, for you to use your own network you need to edit /etc/hosts.allow add the line sshd sshd1 ssh X11 sshd-fwd-X11: ALL this will allow the users you will allow access to your network to perform only ssh commands (which includes scp and sftp commands) this will also prevent users from full access to all features, which could lead to problems down the road. Further this allows X11 tunneling so GUI's may be launched over the network. Below this line you must define what you mean by "ALL", and allow portmapping Add the lines portmap: 172.100.0.100 \ 172.100.0.101 \ 172.100.0.103 ALL: \ 172.100.0.100 \ 172.100.0.101 \ 172.100.0.103 This will first allow the given IP addresses access to portmapping (critical for nfs). ALL is now defined to mean only those 3 IP addresses. The simplicity of this is in the future when you add more machines to your network you only edit a few parts of this file. These edits update the system automatically, so be careful if you are editing a machine remotely, the edit to hosts.deny can block future attempts to access that machine leaving you in the lurch to work directly on the machine (recommended anyways) ------------------------------------------------------------------------------- With this done, let's look at nfs. First check your system for the nfs-utils package. Without this your nfs attempts will be frustrating, and quite pointless. I use Mandriva so the command rpm -qa | grep nfs should return that package (appended with version numbers) at the very least. If not, I like to use urpmi (see easy urpmi webpage for details on easy configuration of this command). urpmi nfs-utils and it should be done. Other systems might use yum, or other package managers) also look out for a nfs-utils-clients and use urpmi to install this too. Once this is done, use service nfs start or /sbin/service nfs start this will start the nfs service. Alone this does not do much, so we proceed to make this fun ------------------------------------------------------------------------------- now with the different computers on your router that have been added in /etc/hosts you will want to note all directories you wish to share between the machines. these directories are to be recorded in /etc/exports So in /etc/exports add the lines /home kdl1(rw,async,no_root_squash) /home mhd1(rw,async,no_root_squash) /mnt/windows kdl1(ro,async,no_root_squash) /mnt/windows mhd1(ro,async,no_root_squash) where I wish to share mhd2's /home and /mnt/windows directories via nfs to the machines mhd1 and kdl1. The options in ()'s will vary between OS's and even versions of nfs. the first option (rw or ro) mean read-write or read-only allowing users on say mhd1 to edit the contents of /home on mhd2, but that same machine is only allowed to view the contents of /mnt/windows on mhd2. It is up you what permissions you give the users and machines. (Although a windows mount is usually limited to ro with ntfs) async allows for asyncronous file editing (more than one person can edit a file before saving it to a storage medium), and no_root_squash, well perform a 'man exports' on a machine with nfs and read... Now save the file and type 'exportfs -ar' to update and refresh the system as to which directories are exported. (Note exportfs is installed with nfs-utils) ------------------------------------------------------------------------------- Now having done this to all machines in your network, you are ready to edit the /etc/fstab so within the /etc/fstab on mhd2 I added mhd1:/home /d/mhd1/home nfs rw,rsize=8192,wsize=8192,hard,bg,intr 0 0 the first is the machine and the directory on that machine that we wish to access via nfs the second is the mount point (note this directory needs to be empty otherwise it can be over-writen, and that this directory must exist) the third is the file system, this must be nfs the next section are options, the rw is read-write, the rest can be seen on the fstab man page Now save this, and exit the editor ------------------------------------------------------------------------------- now type service nfs restart service netfs restart and viola you are done (if not well, I may have missed something, this will be edited better the next time I setup a network, but this ia a quick crash course on how to handle networking and is a compilation of several webpage's advice on the matter) stay tuned for the samba (windows to linux and linux to windows networking)