# NFS Permission Denied

## calble

I am in need of assistance in reguards to configuring NFS properly.  

I get an error when I try to mount my NFS export:

I run this command:  mount linda:/opt/noah /home/noah/nfs/jsp_linda/

and get this error message: mount: linda:/opt/noah failed, reason given by server: Permission denied

My /etc/exports is:

opt/tomcat5/webapps/ROOT 192.168.1.0/255.255.255.0(async,no_subtree_check,rw)

opt/noah 192.168.1.105(async,no_subtree_check,rw,no_root_squash)

My /etc/hosts is:

192.168.1.30    nexjen

192.168.1.60    copan

192.168.1.15    linda

192.168.1.70    binda

127.0.0.1       linda

127.0.0.1       localhost

# IPV6 versions of localhost and co

::1 ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

I have nfs client and server kernel options compiled into both nexjen and lnda and have emerged nfs-utils on both.  nfs starts up fine on linda(the server).

----------

## col

Try adding no_root_squash like so:

/home/httpd/htdocs 192.168.1.0/24(rw,no_root_squash)

----------

## calble

I did try that but it still didn't work.

----------

## b060

I do have the same problem.

It all was working fine and on a blackdown it did not

----------

## Aurisor

 *Quote:*   

> 
> 
> opt/noah 192.168.1.105(async,no_subtree_check,rw,no_root_squash) 
> 
> 

 

In that line you're giving permission to 192.168.1.105....but your hosts doesn't have that IP.  Is it possible you meant 192.168.1.15 instead?

Unless you have untrusted machines on your lan just use netmasks instead:

 *Quote:*   

> 
> 
> 192.168.0.0/255.255.0.0(rw,sync)
> 
> 

 

That allows 192.168.*.* instead.

----------

## calble

I was talking to a coworker and he reminded me that you can only export directories that are mounted as disk drives.  So once I exports the / on my home network everything started to work.  It isn't the safest solution but it will work until I find a cheap disk to mount in that directory.

Thanks,

--Noah

----------

## b060

I have 

```
/usr/servidor
```

 as my shared directory and as far as I understand I don't need to mount anything and even doing tests mounting the resource on the same server (192.168.0.100) I get the same:

```
# mount 192.168.1.100:/usr/servidor/ /tmp/

mount: 192.168.1.100:/usr/servidor/ failed, reason given by server: Permission denied

```

```
# /etc/exports: NFS file systems being exported.  See exports(5).

/usr/servidor/* 192.168.1.150(async,no_subtree_check,rw,no_root_squash)

/usr/servidor/* 192.168.1.110(async,no_subtree_check,rw,no_root_squash)

/usr/servidor/* 192.168.1.100(async,no_subtree_check,rw,no_root_squash)

/usr/servidor/* 192.168.1.190(async,no_subtree_check,rw,no_root_squash)

/usr/servidor/* 192.168.1.140(async,no_subtree_check,rw,no_root_squash)

```

I hope maybe can shed some light on this

----------

## Aurisor

 *calble wrote:*   

> I was talking to a coworker and he reminded me that you can only export directories that are mounted as disk drives.  So once I exports the / on my home network everything started to work.  It isn't the safest solution but it will work until I find a cheap disk to mount in that directory.
> 
> Thanks,
> 
> --Noah

 

Dude, your coworker is wrong.  My development server's exports looks like this:

 *Quote:*   

> 
> 
> # /etc/exports: NFS file systems being exported.  See exports(5).
> 
> /var/www        192.168.0.0/255.255.0.0(rw,sync)
> ...

 

For that matter, check the man page...there are plenty of examples of mounting individual directories.

If mounting your / has bypassed whatever permission problems you're having, great, but don't go buying a new hdd for this.

----------

## b060

Is my exports right?

----------

## Aurisor

 *b060 wrote:*   

> Is my exports right?

 

Try this:

```

# /etc/exports: NFS file systems being exported. See exports(5).

/usr/servidor 192.168.1.0/255.255.255.0(async,no_subtree_check,rw,no_root_squash) 

```

I'm pretty sure having /* on the end of your directories is wrong.

----------

## b060

thanks

----------

