[PLUG] Stupid NFS question

King Beowulf kingbeowulf at gmail.com
Sun Dec 22 10:51:11 UTC 2013


On 12/21/2013 11:07 PM, John Jason Jordan wrote:
> My laptop is 192.168.0.155 and has a 3 TB external drive "Movies"
> mounted at /media/jjj/Movies. My desktop is 192.168.0.146. I want to
> mount "Movies" on the desktop at /media, but manually, not
> automatically. 
> 
> I have it almost set up. On the desktop showmount -e 192.168.0.155
> shows the laptop share. On the laptop /etc/exports has the line:
> 
> /media/jjj/Movies 192.168.0.155(rw,insecure,no_subtree_check,sync)
> 
> On the desktop when I try to mount the share:
> 
> sudo mount 192.168.0.155:/media/jjj/Movies /media/jjj
> 
> I get:
> 
> mount.nfs: access denied by server [the laptop] while mounting
> 192.168.0.155:/media/jjj/Movies
> 
> Somehow I need to get the desktop to communicate my laptop password to
> the laptop. Or is there a simpler way to do this? Note that security is
> not an issue here. 


I assume you have started all the correct daemons and modules on the
server (laptop):
rpc.statd
rpc.portmap
nfsd
nfsd.ko

(appropriate init scripts will depend on your distro)

and configured properly
/etc/hosts.allow:

portmap:192.168.0.0/255.255.255.0 127.0.0.1
lockd:192.168.0.0/255.255.255.0 127.0.0.1
statd:192.168.0.0/255.255.255.0 127.0.0.1
mountd:192.168.0.0/255.255.255.0 127.0.0.1
rquotad:192.168.0.0/255.255.255.0 127.0.0.1

/etc/hosts.deny:

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

/etc/hosts.equiv:

localhost

and your /etc/exports should look like:

/media/jjj/Movies
192.168.0.0/255.255.255.0(rw,no_subtree_check,root_squash)
127.0.0.1(no_subtree_check,sync)

(all one line).

The NFS client then needs daemons running:
rpc.statd
rpc.portmap

You can now mount with

sudo mount 192.168.0.155:/media/jjj/Movies /media/jjj

NOTE:
If /media/jjj/Movies is owned by root:root you may not be able to mount.
 chmod -R <your local user>:users /media/jjj/Movies

If you have a firewall running (iptables, etc), you will have to "poke a
hole" for nfs.

This is how I have it set up so my desktop can share a drive "data" with
any client on my internal network. No password required.

-Ed






More information about the PLUG mailing list