1
00:00:00,000 --> 00:00:09,000
So let's install the appropriate packages.

2
00:00:09,000 --> 00:00:15,600
sudo apt install nfs-kernel-server is what it's called on Ubuntu.

3
00:00:15,600 --> 00:00:21,000
And if you also want the client, I advise to install nfs-common as well.

4
00:00:21,000 --> 00:00:24,000
So yeah, we want to install that.

5
00:00:24,000 --> 00:00:29,000
And then sudo vim-etc-exports.

6
00:00:29,000 --> 00:00:36,000
And let's just export the slash var directory.

7
00:00:36,000 --> 00:00:44,000
To what? Well, to star rw no root squash.

8
00:00:44,000 --> 00:00:47,000
We don't have to go very deep into NFS options.

9
00:00:47,000 --> 00:00:52,000
So the wide open share will do well enough.

10
00:00:52,000 --> 00:00:57,000
So do we have UFW open?

11
00:00:57,000 --> 00:01:02,000
Let's check using sudo ufw status.

12
00:01:02,000 --> 00:01:06,000
And there we can see that UFW is currently inactive.

13
00:01:06,000 --> 00:01:08,000
Well, that makes it easier.

14
00:01:08,000 --> 00:01:12,000
I like to start using show mount minus e localhost.

15
00:01:12,000 --> 00:01:16,000
Before I go remotely, I want to show if mounts are available locally.

16
00:01:16,000 --> 00:01:20,000
And no, no, I don't see anything. Does that make sense? Of course it does.

17
00:01:20,000 --> 00:01:26,000
Sudo systemctl start nfs-utils.service.

18
00:01:26,000 --> 00:01:31,000
And then show mount minus e localhost is still not showing it.

19
00:01:31,000 --> 00:01:33,000
Hmm, that is curious.

20
00:01:33,000 --> 00:01:36,000
What I'm looking for is not nfs-utils.service.

21
00:01:36,000 --> 00:01:39,000
It's nfs-server.service.

22
00:01:39,000 --> 00:01:41,000
So where is it?

23
00:01:41,000 --> 00:01:48,000
Let me use systemctl list unit files pipe-grep nfs.

24
00:01:48,000 --> 00:01:50,000
That's the best solution.

25
00:01:50,000 --> 00:01:55,000
And there I can see that, oh, nfs-server.service is already enabled.

26
00:01:55,000 --> 00:01:56,000
And you know what?

27
00:01:56,000 --> 00:01:59,000
This is a curiosity in systemd.

28
00:01:59,000 --> 00:02:02,000
If you use sudo systemctl start

29
00:02:02,000 --> 00:02:06,000
and then you use tab completion on a server that is already started,

30
00:02:06,000 --> 00:02:08,000
it won't show.

31
00:02:08,000 --> 00:02:15,000
So I'm just going to use sudo systemctl restart nfs-server.

32
00:02:15,000 --> 00:02:19,000
The thing on Ubuntu is that you install a service.

33
00:02:19,000 --> 00:02:22,000
Then it will automatically be started.

34
00:02:22,000 --> 00:02:25,000
So if after installation you create the configuration,

35
00:02:25,000 --> 00:02:27,000
you need to restart it.

36
00:02:27,000 --> 00:02:31,000
And now the show mount minus e on local h.

37
00:02:31,000 --> 00:02:33,000
No, let's make that localhost.

38
00:02:33,000 --> 00:02:36,000
As you can see, that is working now.

39
00:02:36,000 --> 00:02:39,000
And feel free to access it from the client as well.

