NFS mounting and permissions

Need some help with mounting share using NFS. I configured both the server and client stations with NFS server and NFS client settings respectively. Here is the configs:
Code:
shlus# grep nfs /etc/rc.conf - on server
rpcbind_enable="YES"
nfs_client_enable="YES"
nfs_server_enable="YES"
nfs_server_flags="-u -t -n 4"
mountd_flags="-r"

Code:
$ grep nfs /etc/rc.conf - on client
nfs_client_enable="YES"  
nfs_client_flags="-n 4"
On NFS server the /share directory is created.
On NFS client home/trojan/mount directory is created.
Here is the /etc/exports config:
Code:
/share  -maproot=root  trojan

Both on NFS server and client the user trojan with GID 1001 and UID 1001 is created.

When I try to mount share under trojan user I get the following:

Code:
$ mount shlus:/share /home/trojan/mount
[udp] shlus:/share: Permission denied

What is the cause of it?
 
Trojan said:
When I try to mount share under trojan user I get the following:

Code:
$ mount shlus:/share /home/trojan/mount
[udp] shlus:/share: Permission denied

What is the cause of it?

You need to be root to mount nfs shares.
 
trev said:
Does
Code:
/etc/rc.d/mountd restart
have any effect?
Unfortunately not. I restarted the daemon on server and client and hadn't any success.

SirDice said:
You need to be root to mount nfs shares.
But what about the trivial user who need to mount some share?
At least as I know one can specify the user who will be able to mount the share in /etc/exports file.

I also tried to mount the share under root and here is the result:
Code:
bsdcli# whoami
root
bsdcli# mount shlus:/share /home/trojan/mount
[udp] shlus:/share: RPCPROG_NFS: RPC: Port mapper failure - RPC: Timed out
[udp] shlus:/share: RPCPROG_NFS: RPC: Port mapper failure - RPC: Timed out
and so on ...

May be I made some mistakes in config files (though I configured it according to handbook).
Could you please check my config files. Is it correct or not?
 
Trojan said:
At least as I know one can specify the user who will be able to mount the share in /etc/exports file.
No, you cannot. The last entry on a line in exports is a netgroup(5) not a username. See exports(5)

I also tried to mount the share under root and here is the result:
Code:
bsdcli# whoami
root
bsdcli# mount shlus:/share /home/trojan/mount
[udp] shlus:/share: RPCPROG_NFS: RPC: Port mapper failure - RPC: Timed out
[udp] shlus:/share: RPCPROG_NFS: RPC: Port mapper failure - RPC: Timed out
and so on ...

May be I made some mistakes in config files (though I configured it according to handbook).
Could you please check my config files. Is it correct or not?

It's not allowing you because your client machine isn't part of the netgroup.
 
SirDice said:
No, you cannot. The last entry on a line in exports is a netgroup(5) not a username. See exports(5)

It's not allowing you because your client machine isn't part of the netgroup.

What do you mean under meaning "netgroup"? The name of workgroup or domain or what?
 
/share -maproot=root trojan

If "trojan" is a user, then you do not understand the format of the exports(5) file. It must either be a machine name or a netgroup(5) name.

The exports file gives remote machines access to file systems on the local machine. Not users.
 
I changed the username trojan for machine name bsdcli but still have no success. :q

Code:
shlus# cat /etc/exports
/share  -maproot=root  bsdcli

Code:
bsdcli# mount shlus:/share /home/trojan/mount
[udp] shlus:/share: RPCPROG_NFS: RPC: Port mapper failure - RPC: Timed out
[udp] shlus:/share: RPCPROG_NFS: RPC: Port mapper failure - RPC: Timed out
[udp] shlus:/share: RPCPROG_NFS: RPC: Port mapper failure - RPC: Timed out

One nuance: initially the /etc/exports file wasn't existed because during the installation of system I didn't shoose the system to act as NFS server.

Can it be the cause of this issue?
 
Trojan said:
One nuance: initially the /etc/exports file wasn't existed because during the installation of system I didn't shoose the system to act as NFS server.

Can it be the cause of this issue?

Unlikely. Is mountd running on the server? Is there a firewall?
 
Is bsdcli resolvable? Try to use an IP address.
You can check if the shares are exported correctly using the showmount(8) command.
 
Back
Top