Hey everyone and welcome back. Now in the previous nugget we had just walked through
the NFS configuration for the server. This is the component of the architecture where
our share will actually live physically but the whole purpose of this is so people can
access this share. These people who are accessing will be known as the clients and in this nugget
right here this is what we're going to be focusing on the client NFS configuration.
So with that said let's kick on what I will do is I will clear my screen right now and
the first thing I'm actually going to do actually is I'm going to have another machine
in use. So right now if I minimize I have an SSH session but as you know I have this virtual
machine which I'm accessing right here that is all this if I log on in right now and I open this
up open the terminal and I do an IP adder we can see this is the IP address for this machine 192.1680.44
this is the server for NFS. What I'm now going to do is I'm going to start up another machine
which I have on my virtual box on the same network that can actually communicate with this device.
So I have this other Zaboon to machine let me just start that one up give this a moment.
Okay so let me just log into this other machine which I will be using as the NFS client. Okay I
will open up a terminal emulator right here I'll fill in this in fact let me just make the text a
little bit bigger. Okay select you okay so on this machine right here if I do an IP adder we can see
we are on the same network this time we're using the .70 address now the server should be on .44.
Let's see if I have connectivity which I do that's great so what I'm going to do now is I'm going to
install a package known as NFS common so I will say sudo apt install nfs-common and I will type in my
password for this machine or this user on this machine should I say and hit yes right here.
Okay so the first thing which I'm going to do is I'm going to create a directory in which to mount
this file system so I will go into the cd mount directory and I will just create a directory
called my share so sudo mkdir my share if I do an ls we now have this directory right here now the
first thing which I am going to do is I'm going to attempt to mount this particular file system
we are sharing so you'll recall is that on the server if I go back here and I cat the
exports file the share is called my share and right now it has access to anyone on the 192 1680.0
slash 24 network now this device over here we can see indeed that is within that 192 1680.0 range
so we should be able to get access so what I'm going to have to do is I'm going to have to specify
the server that I'm trying to connect to as well as the mount as well as whereabouts I want to
mount this so remember our mount point is going to be within here so what I will do is I will say
sudo mounts and then I will give the name of the server I'm trying to reach or the ip address so the
ip address of the server is 192 1680.44 I'll then do a colon followed by a forward slash and then the
name of the share so that's just called my share if you recall that is what is within our xexports
file on the server and now I want to specify whereabouts I want to attempt to mount this so it's
going to be within the mnt directory and then my share so if I enter here and I do an ls I go into
my share right now what we should be doing right now here in fact if I just go back we should be
accessing this particular folder on the server itself i.e the nfs server so if I go in here
sudo touch file one I do an ls we now have this file here if I go to the server and I go into
the my share directory I do an ls notice file one does actually exist you see that so if I do an ls
dash l here notice the file was actually created by nobody and no group this is a little bit of a
problem with respect to our permissions whereas if I go back what I want to do is I want to create a
id mapping of the users on the two systems so what I'm going to do here is I will say sudo user ads
and I'm going to say dash u and I'll give it a unique id of 1234 and I'll just call this one user
john mcg okay and if I say sudo password for john mcg I'll just have the password as hello
and I will confirm it as hello so now if I go into my password file if I go down we can see we have
the user john mcg but we also have a particular id for this user 1234 what I want to do is I actually
want to go over to the server itself and create that same user with the same id so I'll go to
the server I'll say sudo user ad I will give it the user of 1234 and it will be john mcg I'll type in
my password for my super user and now I will create a password for that user so for john mcg again it
will just be hello keeping things simple and if I go in sudo cat it's a password indeed we now have
the same user with the same numerical id on this system so what I'm going to do here is if I go back
to my client and I change into that user john mcg by substituting user and I'll type in the
password of hello and I say who am I we can see I am a john mcg if I do an ls we can see the file
that has been created within this directory and if I do a pwd we can see the directory we are with
them if I create a new file called touch file 2 and I do an ls-l we can actually see this time
this file was created with the user john and the group john mcg so we can actually see the file
has the permissions of john mcg now if we go back there should be a synchronization here because we
actually have the same user id the uid and the same gid on both the client and the server this
should be recognized meaning that if I go back to the server itself and I do an ls we can see we
have file 2 if I do an ls-l notice here file 2 is actually being created by john mcg meaning that
we have that synchronization of the same user with the same unique identifier mapped across
both devices so that when that user makes changes on the client there is going to be no conflict of
permissions anywhere everything is ultimately going to be synced up and correct so now whilst
we actually are on the server still if I happen to say sudo nfs stat with dash s for server statistics
I can see I actually do have some values populating right here if I go back to my client machine and
I change from john mcg and I go back into ipv0 which has super user privileges type in ipv0's
password and I do sudo nfs stat dash c for the client statistics we can actually see the client
statistics on this machine here you see that also if we use the command df dash h we can actually see
what is being mounted notice at the very bottom locally within mount my share what is actually
being mounted is not a particular disk on our device say for example disk one partition one
instead what is being mounted is this server ip address and this particular share you see that
because ultimately we are just transparently accessing this device over the network and accessing
this particular file system right here so that is us for our basic introduction into the client
configuration for nfs we still have a few more things that we have to understand so how about we
keep on moving then but for now I hope this has been informative for you I'd like to thank you for viewing