1
00:00:00,000 --> 00:00:17,820
Hey everyone and welcome back. Now in the previous nugget we had just walked through

2
00:00:17,820 --> 00:00:24,440
the NFS configuration for the server. This is the component of the architecture where

3
00:00:24,440 --> 00:00:30,120
our share will actually live physically but the whole purpose of this is so people can

4
00:00:30,120 --> 00:00:36,120
access this share. These people who are accessing will be known as the clients and in this nugget

5
00:00:36,120 --> 00:00:42,320
right here this is what we're going to be focusing on the client NFS configuration.

6
00:00:42,320 --> 00:00:47,480
So with that said let's kick on what I will do is I will clear my screen right now and

7
00:00:47,480 --> 00:00:52,520
the first thing I'm actually going to do actually is I'm going to have another machine

8
00:00:52,600 --> 00:00:58,920
in use. So right now if I minimize I have an SSH session but as you know I have this virtual

9
00:00:58,920 --> 00:01:04,520
machine which I'm accessing right here that is all this if I log on in right now and I open this

10
00:01:04,520 --> 00:01:12,280
up open the terminal and I do an IP adder we can see this is the IP address for this machine 192.1680.44

11
00:01:12,840 --> 00:01:18,359
this is the server for NFS. What I'm now going to do is I'm going to start up another machine

12
00:01:18,359 --> 00:01:24,200
which I have on my virtual box on the same network that can actually communicate with this device.

13
00:01:24,200 --> 00:01:29,480
So I have this other Zaboon to machine let me just start that one up give this a moment.

14
00:01:29,480 --> 00:01:35,079
Okay so let me just log into this other machine which I will be using as the NFS client. Okay I

15
00:01:35,079 --> 00:01:40,840
will open up a terminal emulator right here I'll fill in this in fact let me just make the text a

16
00:01:40,840 --> 00:01:46,760
little bit bigger. Okay select you okay so on this machine right here if I do an IP adder we can see

17
00:01:46,760 --> 00:01:54,359
we are on the same network this time we're using the .70 address now the server should be on .44.

18
00:01:54,359 --> 00:02:00,040
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

19
00:02:00,040 --> 00:02:08,759
install a package known as NFS common so I will say sudo apt install nfs-common and I will type in my

20
00:02:08,759 --> 00:02:13,560
password for this machine or this user on this machine should I say and hit yes right here.

21
00:02:13,560 --> 00:02:19,479
Okay so the first thing which I'm going to do is I'm going to create a directory in which to mount

22
00:02:19,479 --> 00:02:25,800
this file system so I will go into the cd mount directory and I will just create a directory

23
00:02:25,800 --> 00:02:32,920
called my share so sudo mkdir my share if I do an ls we now have this directory right here now the

24
00:02:32,920 --> 00:02:39,400
first thing which I am going to do is I'm going to attempt to mount this particular file system

25
00:02:39,560 --> 00:02:46,840
we are sharing so you'll recall is that on the server if I go back here and I cat the

26
00:02:46,840 --> 00:02:54,759
exports file the share is called my share and right now it has access to anyone on the 192 1680.0

27
00:02:54,759 --> 00:03:04,439
slash 24 network now this device over here we can see indeed that is within that 192 1680.0 range

28
00:03:04,439 --> 00:03:10,759
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

29
00:03:10,759 --> 00:03:16,280
the server that I'm trying to connect to as well as the mount as well as whereabouts I want to

30
00:03:16,280 --> 00:03:21,560
mount this so remember our mount point is going to be within here so what I will do is I will say

31
00:03:21,560 --> 00:03:27,240
sudo mounts and then I will give the name of the server I'm trying to reach or the ip address so the

32
00:03:27,240 --> 00:03:36,520
ip address of the server is 192 1680.44 I'll then do a colon followed by a forward slash and then the

33
00:03:36,520 --> 00:03:41,800
name of the share so that's just called my share if you recall that is what is within our xexports

34
00:03:41,800 --> 00:03:47,320
file on the server and now I want to specify whereabouts I want to attempt to mount this so it's

35
00:03:47,320 --> 00:03:55,320
going to be within the mnt directory and then my share so if I enter here and I do an ls I go into

36
00:03:55,959 --> 00:04:01,560
my share right now what we should be doing right now here in fact if I just go back we should be

37
00:04:02,120 --> 00:04:09,239
accessing this particular folder on the server itself i.e the nfs server so if I go in here

38
00:04:09,239 --> 00:04:16,439
sudo touch file one I do an ls we now have this file here if I go to the server and I go into

39
00:04:16,439 --> 00:04:24,279
the my share directory I do an ls notice file one does actually exist you see that so if I do an ls

40
00:04:24,279 --> 00:04:31,239
dash l here notice the file was actually created by nobody and no group this is a little bit of a

41
00:04:31,239 --> 00:04:37,799
problem with respect to our permissions whereas if I go back what I want to do is I want to create a

42
00:04:37,799 --> 00:04:45,719
id mapping of the users on the two systems so what I'm going to do here is I will say sudo user ads

43
00:04:45,719 --> 00:04:53,719
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

44
00:04:53,720 --> 00:05:02,200
john mcg okay and if I say sudo password for john mcg I'll just have the password as hello

45
00:05:02,200 --> 00:05:08,120
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

46
00:05:08,120 --> 00:05:15,240
the user john mcg but we also have a particular id for this user 1234 what I want to do is I actually

47
00:05:15,240 --> 00:05:23,640
want to go over to the server itself and create that same user with the same id so I'll go to

48
00:05:23,639 --> 00:05:31,560
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

49
00:05:31,560 --> 00:05:38,120
my password for my super user and now I will create a password for that user so for john mcg again it

50
00:05:38,120 --> 00:05:45,079
will just be hello keeping things simple and if I go in sudo cat it's a password indeed we now have

51
00:05:45,079 --> 00:05:53,000
the same user with the same numerical id on this system so what I'm going to do here is if I go back

52
00:05:53,079 --> 00:05:59,079
to my client and I change into that user john mcg by substituting user and I'll type in the

53
00:05:59,079 --> 00:06:06,199
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

54
00:06:06,199 --> 00:06:10,839
that has been created within this directory and if I do a pwd we can see the directory we are with

55
00:06:10,839 --> 00:06:19,160
them if I create a new file called touch file 2 and I do an ls-l we can actually see this time

56
00:06:19,160 --> 00:06:25,800
this file was created with the user john and the group john mcg so we can actually see the file

57
00:06:25,800 --> 00:06:33,320
has the permissions of john mcg now if we go back there should be a synchronization here because we

58
00:06:33,320 --> 00:06:42,040
actually have the same user id the uid and the same gid on both the client and the server this

59
00:06:42,040 --> 00:06:48,600
should be recognized meaning that if I go back to the server itself and I do an ls we can see we

60
00:06:48,600 --> 00:06:57,879
have file 2 if I do an ls-l notice here file 2 is actually being created by john mcg meaning that

61
00:06:57,879 --> 00:07:05,080
we have that synchronization of the same user with the same unique identifier mapped across

62
00:07:05,080 --> 00:07:11,560
both devices so that when that user makes changes on the client there is going to be no conflict of

63
00:07:11,560 --> 00:07:17,080
permissions anywhere everything is ultimately going to be synced up and correct so now whilst

64
00:07:17,079 --> 00:07:25,079
we actually are on the server still if I happen to say sudo nfs stat with dash s for server statistics

65
00:07:25,079 --> 00:07:31,159
I can see I actually do have some values populating right here if I go back to my client machine and

66
00:07:31,159 --> 00:07:37,799
I change from john mcg and I go back into ipv0 which has super user privileges type in ipv0's

67
00:07:37,799 --> 00:07:45,399
password and I do sudo nfs stat dash c for the client statistics we can actually see the client

68
00:07:45,399 --> 00:07:53,959
statistics on this machine here you see that also if we use the command df dash h we can actually see

69
00:07:53,959 --> 00:08:01,319
what is being mounted notice at the very bottom locally within mount my share what is actually

70
00:08:01,319 --> 00:08:07,479
being mounted is not a particular disk on our device say for example disk one partition one

71
00:08:07,479 --> 00:08:14,519
instead what is being mounted is this server ip address and this particular share you see that

72
00:08:14,519 --> 00:08:20,919
because ultimately we are just transparently accessing this device over the network and accessing

73
00:08:20,919 --> 00:08:27,319
this particular file system right here so that is us for our basic introduction into the client

74
00:08:27,319 --> 00:08:32,279
configuration for nfs we still have a few more things that we have to understand so how about we

75
00:08:32,279 --> 00:08:38,120
keep on moving then but for now I hope this has been informative for you I'd like to thank you for viewing

