1752304 Members
4796 Online
108786 Solutions
New Discussion юеВ

NFS:Permission Denied

 
SOLVED
Go to solution
Malps
Advisor

NFS:Permission Denied

Hi All

I am learning NFS & trying to mount an FS from server A to Client B.

Both the servers have 11.23 OE

I have updated /etc/exports as follows on server A

/home -access=B
/tmp -access=B

#exportfs
/home -access=B
/tmp -access=B

restarted nfs.core & nfs.server

#rpcinfo -p
program vers proto port service
100000 4 tcp 111 rpcbind
100000 3 tcp 111 rpcbind
100000 2 tcp 111 rpcbind
100000 4 udp 111 rpcbind
100000 3 udp 111 rpcbind
100000 2 udp 111 rpcbind
100005 1 udp 49417 mountd
100005 3 udp 49417 mountd
100005 1 tcp 63547 mountd
100005 3 tcp 63547 mountd
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100024 1 tcp 63554 status
100024 1 udp 49418 status
100021 1 tcp 63555 nlockmgr
100021 1 udp 49420 nlockmgr
100021 3 tcp 63556 nlockmgr
100021 3 udp 49421 nlockmgr
100021 4 tcp 63557 nlockmgr
100021 4 udp 49422 nlockmgr
100020 1 udp 4045 llockmgr
100020 1 tcp 4045 llockmgr
100021 2 tcp 63558 nlockmgr

On Client B,

I have updated /etc/rc.config.d/nfsconf to make this host as NFS Client.

Restarted nfs.core & nfs.client

#rpcinfo -p
rpcinfo: onc10: n2a: hostname not found

# rpcinfo -s
program version(s) netid(s) service owner
100000 2,3,4 udp,tcp,ticlts,ticotsord,ticots rpcbind superuser
100024 1 udp,tcp status superuser
100021 2,4,3,1 udp,tcp nlockmgr superuser
100020 1 tcp,udp llockmgr superuser
100099 3 ticotsord automountd superuser

Now I try to mount as follows:-

#mount A:/home /home.A (on client)
Permission denied

I checked for permission of /home on the NFS Server

drwxrwxrwx 3 bin bin 96 Nov 3 17:13 /home

Please let me know what am I missing?

I have referred some of the previous threads but couldn't find a suitable solution.

Any Help is appreciated.

Thanks!

9 REPLIES 9
R.K. #
Honored Contributor

Re: NFS:Permission Denied

Hi Malps,

Server A:

Add "rw" option in /etc/exports and then "exportfs -a".
Don't fix what ain't broke
R.K. #
Honored Contributor
Solution

Re: NFS:Permission Denied

What about adding
/home -root=B
in /etc/exports of server A.
Don't fix what ain't broke
Malps
Advisor

Re: NFS:Permission Denied

Hi R.K.

Thanks for your response!

-access option seems to be the issue.

I tried with -rw option but that option is not recognised by exportfs & it shows

# exportfs -a
exportfs error: unknown option: rw
exportfs error: unknown option: rw

option -ro & root=B option works fine.

Any Idea why -rw not working?

Vishu
Trusted Contributor

Re: NFS:Permission Denied

Hi Malps,

By default, its rw. so better you just write your /etc/exports without any options,

/home
/tmp

then do, exportfs -a followed by mounting of this FS.
Patrick Wallek
Honored Contributor

Re: NFS:Permission Denied

>>By default, its rw. so better you just write
>>your /etc/exports without any options,

>>/home
>>/tmp

The problem with this is that there is NO security on your NFS mount points now. ANYONE could potentially mount them, which could be VERY bad.

You really need to figure out the access issue.

You might try specifying the fully qualified name like -access=a.myco.com or even use the IP address.

If this server has multiple IP addresses or host names, you can also try specifying all of them in the access list like:

/home -access=a:a1:a2
Malps
Advisor

Re: NFS:Permission Denied

@Vishu

Thanks For your reply!! I'll remember that.

@Patrick

Both are the test servers so Security wise there is no Problem.

But yes,I will remember it when applying it on a Production server.Thanks for that.

Now I am trying to make a server with 11.31 OE as NFS Server & Mounting it from a client with 11.23 OE,

Following are the details

ON NFS Server:- Named "aus"

#share
- /home rw=xport,ro=onc ""

#ls -ld /home
dr-xr-xr-x 7 bin bin 96 Dec 15 19:36 /home

----------------------------
On client:- named "xport"
----------------------------

#mount aus:/home /aus.home/
Permission denied

#ls -ld /aus.home/
drwxrwxrwx 2 root sys 96 Dec 21 12:20 /aus.home/

#rpcinfo -p
\ program vers proto port service
100000 4 tcp 111 rpcbind
100000 3 tcp 111 rpcbind
100000 2 tcp 111 rpcbind
100000 4 udp 111 rpcbind
100000 3 udp 111 rpcbind
100000 2 udp 111 rpcbind
100024 1 tcp 55798 status
100024 1 udp 53654 status
100021 1 tcp 55799 nlockmgr
100021 1 udp 53656 nlockmgr
100021 3 tcp 55800 nlockmgr
100021 3 udp 53657 nlockmgr
100021 4 tcp 55801 nlockmgr
100021 4 udp 53658 nlockmgr
100020 1 udp 4045 llockmgr
100020 1 tcp 4045 llockmgr
100021 2 tcp 55802 nlockmgr

#rpcinfo -s
program version(s) netid(s) service owner
100000 2,3,4 udp,tcp,ticlts,ticotsord,ticots rpcbind superuser
100024 1 udp,tcp status superuser
100021 2,4,3,1 udp,tcp nlockmgr superuser
100020 1 tcp,udp llockmgr superuser
100099 3 ticotsord automountd superuser


---------------------------
on client named "onc"
---------------------------

#mount aus:/home /aus.home/
Permission Denied

ls -ld /aus.home/
drwxrwxrwx 2 root sys 96 Dec 21 12:20 /aus.home/

# rpcinfo -p
rpcinfo: onc: n2a: hostname not found --> (what does this mean?)


# rpcinfo -s
program version(s) netid(s) service owner
100000 2,3,4 udp,tcp,ticlts,ticotsord,ticots rpcbind superuser
100024 1 udp,tcp status superuser
100021 2,4,3,1 udp,tcp nlockmgr superuser
100020 1 tcp,udp llockmgr superuser
100099 3 ticotsord automountd superuser



Please let me know where am I going wrong?

Why Am I getting Permission Denied?



Dave Olker
HPE Pro

Re: NFS:Permission Denied

My guess is all of these problems are somehow related to hostname resolution. What mechanism are you using for hostname resolution on your NFS clients and servers? DNS? NIS? LDAP? /etc/hosts?

On 11i v3 you need to use fully-qualified hostnames in the share access lists in order for mountd to match the incoming mount requests. If you're using something like DNS I'd first try sharing the filesystems using the fully-qualified names returned by DNS. So "onc" and "xport" would become "onc.whateveryourdomainis.com", etc.

The error message returned by rpcinfo -p on client onc again points to hostname resolution. Are you positive that "onc" is listed in the hostname resolution database you're using (DNS, LDAP, /etc/hosts)?

Regards,

Dave
I work for HPE

[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
Malps
Advisor

Re: NFS:Permission Denied

Hi Dave

I am using DNS on all the machines for Name Resolution.Name resolution works fine on all hosts.

I have also updated the dfstab on the NFS server "aus" with the FQDN of hosts.

But still the error message persists "Permission Denied"

What else can be tried?
Dave Olker
HPE Pro

Re: NFS:Permission Denied

Please cut/paste the exact contents of your dfstab file so I can see the syntax you're using.

If we still cannot determine the cause of the permission denied problem by analyzing the syntax of the dfstab, the best way to troubleshoot these types of problems is to enable debug rpc.mountd logging on the NFS server system, reproduce the problem, then analyze the debug log file.

To do this you send a SIGUSR2 signal to the running rpc.mountd daemon on the NFS server:

# ps -e | grep rpc.mountd
# kill -17

This will enable debug logging to the file /var/nfs/mountd.log. Reproduce the failing mount attempt and then send another SIGUSR2 to the rpc.mountd daemon to turn off debug logging.

You can look at the /var/nfs/mountd.log file to figure out why it's throwing a permission denied error or you can post the log file to this thread so we can help you analyze the log file.

If you're uncomfortable posting the log file data to a public forum then you can email the debug log file to me and I'll take a look at it.

Regards,

Dave
dave.olker@hp.com
I work for HPE

[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo