Link to home
Start Free TrialLog in
Avatar of TomEA
TomEA

asked on

Proper Command to Mount NFS Share in Ubuntu Linux

Hi folks!

This should be simple, but I'm not having much luck putting it together. Can someone please give me the proper syntax for the mount command in Ubuntu Linux 9.10 to mount an NFS share on a remote server? It needs to specify a username and password for the remote server, as it is not the same username and password being used on the local Ubuntu machine.

Thanks!

- Tom
Avatar of Fabio Marzocca
Fabio Marzocca
Flag of Italy image

sudo mount ServerIP:/folder/already/setup/to/be/shared /home/username/folder/in/your/local/computer

You can have a full ubuntu's howto here:

https://help.ubuntu.com/community/SettingUpNFSHowTo
Avatar of TomEA
TomEA

ASKER

Right, that part of the command I've gotten. However, when I use it like that, I get an error that says "access denied by server while mounting [path]". The reason is because the usernames on the remote server are different from those on the local Linux machine. I need to specify the user account to be used when logging into the remote server. That is the part I don't know how to do.
ASKER CERTIFIED SOLUTION
Avatar of Fabio Marzocca
Fabio Marzocca
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi!

You can't specify an username when mounting NFS. One solution might be to change the file access rights on the server.

Read this page: http://www.troubleshooters.com/linux/nfs.htm

"User ID Mapping Options
In an ideal world, the user and group of the requesting client would determine the permissions of the data returned. We don't live in an ideal world. Two real-world problems intervene:

   1. You might not trust the root user of a client with root access to the server's files.
   2. The same username on client and server might have different numerical ID's"

Regards, Tobias
Avatar of TomEA

ASKER

Thanks, folks! I was able to get it solved and mapped.

Now, one last question: How do I go about making the mapping happen automatically each time the Linux machine boots? I have a CIFS/Samba share mapping automatically each time via the /etc/fstab file. Will the same work for NFS shares? Is there a different syntax I need to use?

Thanks again!
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TomEA

ASKER

Thanks everyone!