Manual for Debian Etch/Squeeze
In this small howto, we gonna set up two computers in the local network to share directories.
Without a DNS server and dynamically assigned IP addresses, we usually have the problem, that IP addresses may change and the client doesn’t know the servers IP address automatically.
Now, by using avahi, we can assign names to our computers, that can be retrieved by the others in the same local network.
These names always end with .local, a possible name for our server would thus be server.local.
- Install avahi daemon, if not yet installed
- Install NFS-kernel-server, if not installed yet
Like this in Squeeze, drop the nfs-common part in Etch:
aptitude install avahi-daemon nfs-common nfs-kernel-server
Not explained here in detail, please use your favorite search engine to find out, if necessary.
You will have to set your /etc/exports file to hold the directories you want to export and give some restriction on the machines that you want to allow to access your shared directories.
Configure avahi for NFS broadcast in local network
Open a terminal window and get root by using su or sudo together with the commands:
Fill the File /etc/avahi/services/nfs.service with the following text:
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<name replace-wildcards="yes">%h</name> ## Name
- Install autofs
- Install NFS client (Debian Etch only)
aptitude install autofs5
aptitude install autofs nfs-client
Text in file /etc/auto.master:
/ /etc/auto.misc --timeout=60
Text in file /etc/auto.misc:
<name Directory for automount on client> <hostname>.local:/<path to NFS-export>
Adjust file rights:
chmod 777 <path to NFS-export>
You can mount your remote directories with a mouse click from your file browser by creating a symlink:
ln -s <
directory for automount on client> <link name>
The directory for automount shall be /mnt.
In auto.misc we would write:
Our symlink shall be created in /home/user/Documents.
Create link as follows:
ln -s /mnt/myavahi /home/user/Documents/avahilink