The document provides instructions for setting up an NFS server on Ubuntu and configuring a Windows 7 client to access shared directories on the NFS server without using Active Directory or SUA. It describes exporting the /home and /var/nfs directories on the Ubuntu server, modifying /etc/exports to share them, and setting the AnonymousUid and AnonymousGid registry values on the Windows client to map users based on the UID and GID on the server. Finally, it provides an example configuration to share the /home/cuongnv directory from the Ubuntu server and access it from the Windows client.
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
NFS ubuntu Server and windows 7 Client
1. Setting Up An Ubuntu NFS Server
and Windows 7 NFS Client
On the NFS server we run:
2. Exporting Directories On The Server
I'd like to make the directories /home and /var/nfs accessible to the client;
therefore we must "export" them on the server.
●
●
●
●
When a client accesses an NFS share, this normally happens as the user
nobody. Usually the /home directory isn't owned by
nobody (and I don't recommend to change its ownership to nobody!), and
because we want to read and write on /home, we tell
NFS that accesses should be made as root (if our /home share was readonly, this wouldn't be necessary). The /var/nfs
directory doesn't exist, so we can create it and change its ownership to
nobody and nogroup:
3. Now we must modify /etc/exports where we
"export" our NFS shares. We specify /home and
/var/nfs as NFS shares and tell
●
NFS to make accesses to /home as root (to learn
more about /etc/exports, its format and available
options, take a look at
4.
5. Windows 7: Client for NFS and User
Name Mapping without AD, SUA
Windows 7: Client for NFS and User Name Mapping
without AD, SUA
●
●
In this tutorial, Mr. Nguyen Viet Cuong (a.k.a. mrcuongnv)
shows us how to mount a NFS share on Windows 7 with
Client for NFS without using neither Active Directory server
nor SUA (Subsystem for UNIX-based Application).
You can visit Mr. Nguyen Viet Cuong´s site at
http://blog.cuongnv.com/2009/11/windows-7-client-for-nfsand-user-name.html.
6. Important: Client for NFS feature is only available
on Windows 7 Ultimate Edition and Enterprise
Edition.
The Client for NFS is included in the Windows 7,
however, it is turned off by default. One can turn it
on by accessControl Panel → Programs →
Programs and Features → Turn Windows features
on or off.
7.
8. - Now, you can mount any NFS share on your network. However, if you try to open
the mounted drive, you are most probable to receive an "Access is denied"
notification. The reason is Windows and UNIX use different mechanisms for user
identification, authentication, and resource access control.
- The mechanism of identifying an user on the Windows-based system is different
from the Unix-based system, which uses User Identification (UID) and Group
Identification (GID). Therefore, to access resources on an Unix-based system from a
Windows-based system and vice versa, we have to map user information between
Windows-based system and Unix-based system.
9. The most popular solutions are using an Active
Directory for mapping user identification or using
SUA. However, that is too complicated for a small
environment, such as home or small office. For
example, in my case, I have two Ubuntu boxes, one
Windows box in the office, and one Windows box in
my dormitory room. NFS server is running on one
of my Ubuntu boxes.
10. By googling, I have found an un-documented trick to set the "default" anonymous UID and GID
for Client for NFS to access a NFS share. Now, you can do it as follows:
●
●
●
●
●
●
●
●
Open the Run box by pressing Windows + R.
Start Registry Editor by running command regedit. Remember to click the Yes button on the
User Account Control window.
Locate
HKEY_LOCAL_MACHINESOFTWAREMicrosoftClientForNFSCurrentVersionDefault.
Add two DWORD values: AnonymousUid and AnonymousGid.
Set theses values to the UID and GID on the Ubuntu box. In the most popular cases, they are
1000 and1000 in decimal base. Actually, it should be the UID and GID of the owner of the
shared directory on the Ubuntu system.
Restart your Client for NFS service or restart your computer.
11. Now, you can access Ubuntu box's NFS share from
your Windows box.
12. On the Ubuntu, I want to share the home directory
of the user cuongnv /home/cuongnv. The owner UID
iscuongnv (1000), and the owner GID is also
cuongnv (1000). I assume that you know how to
install NFS service on the Ubuntu (actually, you
only need to install two package: portmap and nfskernel-server). My Ubuntu box's IP is192.168.0.10,
and I want to share above directory to all the
computers in my network 192.168.0.0/24.
13. Now, on the Ubuntu box, you add the following line
to the file /etc/exports:
14. Then, you need to run command exports -ra. Final,
restart portmap service and nfs-kernel-server service.
On the Windows 7:
Open Computer (or press Windows + E).
Click the Map netwok drive button on the toolbar.
Enter 192.168.0.10:/var/nfs on the Folder text box.
Click Finish