[HLUG] setting up a shared folder between two Ubuntu machines via LAN

John Hedges john at drystone.co.uk
Tue Oct 10 11:17:39 BST 2006


On Tue, Oct 10, 2006 at 10:36:04AM +0100, Matt Rhys-Roberts wrote:
> I have two Ubuntu boxes at home, and I want to directly share files 
> between them as follows:
> 
> Ideally, I'd like to have a special folder on either desktop, into which 
> I can drag & drop files, and they magically appear in the other 
> machine's folder. Both PCs would have equal rights to add or delete files.
> 
> I've heard I need to install & configure Samba for this, thereafter I'm 
> a bit clueless. Has anyone managed to do anything like this please?
> 
> Regards,
> 
> Matt Rhys-Roberts

Samba would work but uses Microsoft protocols. If you don't need access
from a windows box, try nfs as follows (or someting like) ...

You probably only need a shared directory on one PC, so choose the one
that is on most often, or most reliable, or has the newest discs to act
as the nfs server. On this server, log in as root and 'apt-get install
nfs-kernel-server'

To export a directory you need create the directory to share (if you
don't have one already) 'mkdir ~matt/nfs-share; chown matt.
~matt/nfs-share'.  Edit /etc/exports so the server will allow
connections from the other PC. Add a line a bit like this one:

/home/matt/nfs-share client-name-or-ip-address(rw,sync)

Restart nfsd with '/etc/init.d/nfs-kernel-server restart'. You may also
have to similarly restart portmap and mountd - I'm never sure which and
in which order so I generally restart all three, twice :)

On the client PC, log in as root and 'apt-get install nfs-client'.
Create an empty directory on where you can mount the nfs share 'mkdir
~matt/nfs-share; chown matt. ~matt/nfs-share', and add a line to
/etc/fstab:

server-name-or-ip-address:/home/matt/nfs-share /home/matt/nfs-share nfs defaults 0 0

Finally, 'mount ~matt/nfs-share' should make the share available at
/home/matt/nfs-share

Both PCs should now have access to the shared folder with similar
rights.

Neither samba nor nfs are very secure, so be careful about allowing
access from outside your lan.

Cheers

John




More information about the Herefordshire mailing list