LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   *BSD (https://www.linuxquestions.org/questions/%2Absd-17/)
-   -   nfs share: permission denied (https://www.linuxquestions.org/questions/%2Absd-17/nfs-share-permission-denied-517234/)

Kropotkin 01-07-2007 03:43 PM

nfs share: permission denied
 
Hi all,

I am trying to mount a BSD share on a Linux (FC6) box. Here is the line in /etc/exports on my freeBSD 6.1 box (juno):
Code:

/home/krop    -maproot=root  -rw    192.168.1.11
/etc/hosts.allow I have (temporarily) made ALL : ALL : allow

On BSD, I run /etc/rc.d/mountd onereload. On the Fedora box, I run in sudo mount -v juno:/home/krop /mnt/juno but I keep getting:
Code:

mount: juno:/home/krop failed, reason given by server: Permission denied
What I am missing?

Vincent_Vega 01-08-2007 12:26 PM

On the BSD machine you need to have your exports entry showing the directory you're allowing access to and with what permissions, etc.
Is the ip address you give permissions correct for your FC machine?
Is 'juno' listed in your hosts file? If not, you might need to use the ip address of the BSD machine instead of it's name.

Kropotkin 01-08-2007 05:39 PM

No, it isn't a problem with hostnames. mount gives a different error message if you try to mount a share from a nonexistent host.

phil.d.g 01-08-2007 06:12 PM

Are you sure the Fedora box's ip is 192.168.1.11?

Examine the logs, run nfsd, mountd and rpcbind in debug mode if you need more verbose logging

EDIT: One thing thats just come to mind, is /home a symlink to /usr/home, if so you need to export /usr/home/krop

bhart50 01-09-2007 06:57 AM

Is the Fedora server in DNS or the hosts file of the BSD server? If you do a showmount does the bsd server already show the Fedora server as mounted? If neither of these work try changing the address on the fedora box and see if it will mount.

Kropotkin 01-09-2007 05:08 PM

@Phil.d.g: yes I am sure the IP of the Fedora box is correct. I have also tried this in /etc/export to no avail:
Code:

/home/krop    192.168.1.0/255 (rw)
How does one run nfsd, mountd and rpcbind in debug mode? Nothing about that in the man pages.

@bhart50: the Fedora box is in the /etc/hosts file of the BSD server, but I am using just IP numbers right now. Changing the IP number of the Fedora box had no effect. Showmount on the BSD box returns nothing.


I am trying to remember the gotchas from the first time I set up NFS. One was the hosts.allow file. The other was UID/GIDs. With the respect to the latter, I consciously have the same username @ 500:500 on all my systems. Still, I must be missing something else...

phil.d.g 01-09-2007 05:27 PM

mountd and rpcbind can be run in debug mode using the -d flag, this is in the man pages for 6.1 at least.

I'm a bit hazy with this part, but I think if you run nfsd from a terminal without backgrounding it then I think it will log verbosely to the screen.

The one thing that got me when I used nfs was that on FreeBSD you can't use symlinks or relative paths in the export path

Kropotkin 01-09-2007 05:52 PM

Quote:

Originally Posted by phil.d.g
mountd and rpcbind can be run in debug mode using the -d flag, this is in the man pages for 6.1 at least.

Weird, the man page seems to be there, but I can't open it:

Code:

$ locate rpcbind
/etc/rc.d/rpcbind
/usr/sbin/rpcbind
/usr/share/man/man3/rpcbind.3.gz
/usr/share/man/man8/rpcbind.8.gz

$ man rcpbind
No manual entry for rcpbind

$ man 3 rcpbind
No entry for rcpbind in section 3 of the manual

$ man 8 rcpbind
No entry for rcpbind in section 8 of the manual

$ man -k rcpbind
rcpbind: nothing appropriate

I stand corrected: the mountd manpage does list the -d option.

Quote:

The one thing that got me when I used nfs was that on FreeBSD you can't use symlinks or relative paths in the export path
I've run into symlink issues with NFS under Linux as well.

Kropotkin 01-09-2007 06:13 PM

SOLVED, thanks phil.d.g

Running mountd with the -d flag, it writes error messages to /var/log/messages. This enabled me to see it didn't like the -rw flag I was using in the exports file. Nor did it accept 192.168.1.0/255 for hosts; I have to list a range of IPs like this:

Code:

192.168.1.11 192.168.1.12 192.168.1.13
UPDATE hostnames (ie, juno) now also work.

Kropotkin 01-09-2007 06:43 PM

One hiccup yet remains. When I try to export a directory like /usr/local/www, this gets written to /var/log/messages:
Code:

mountd: got line /usr/local/www ariel zeus
mountd: found ep fs=0x32c9b0a5,0xd379d0de
got host ariel
got host zeus
mountd: can't change attributes for /usr/local/www

Anyone know what this error message means? I searched with Google but it didn't turn up any obvious answers.

UPDATE Never mind, solved as well. Multiple directories from same FS in the same line. It's all in the man pages, if you read closely ;) ...

phil.d.g 01-10-2007 04:20 AM

The man pages are wonderful arent they?

Just a note: you don't need to specify all the individual ip addresses, you can specify a network using the -network and -mask flags, for example:
Code:

/home/krop    -maproot=root -network 192.168.1.0 -mask 255.255.255.0

Kropotkin 01-10-2007 08:15 AM

Thanks for the network address tip.

One thing I am having problems with: root permissions. I can edit files in my home directory but when when I try to edit a file owned by root, it is opened read-only.

I have added the -maproot flag to map root to my username, but that doesn't seem to do the trick. Even as root the Linux box (su - or sudo), files are opened read-only on the BSD share.

Could it a group issue? Neither root nor my username is a member of the "wheel" group BSD uses. Or something else?...


All times are GMT -5. The time now is 11:03 AM.