Right, next task was about AutoFS. So what did we need to do? Well, on server 2, create
the directories home user 1 and home user 2 and use NFS to share these directories and
ensure the firewall does not block access to these directories. Then on server 1, create
a solution that automatically on-demand mounts server 2 home user 1 on home user 1 and also
that automatically on-demand mounts server 2 home user 2 on home user 2 when these directories
are accessed. Let me show you. So we'll start on server 2 where I'm using mkdir minus p
slash homes slash user 1 and 2. LS minus L on homes to verify and as you can see, it
works. Then DNF install NFS utils. That's a small typo. We need to install the NFS server
package. And the NFS server package happens to be in the NFS utils. And I need to create
an etc exports. And oh, I still don't have vim. Well, DNF install minus y vim and let's
fix that problem. Then I need an etc exports. And in etc exports, I'm going to export homes
to star RW no root squash. This is absolutely not secure, but this lesson isn't about NFS
security. It's about making it work. Next, systemctl enable. There it says now NFS server.
And let's take care of the firewall. So what is in the firewall? There's a couple of services
for NFS. So for I in RPC bind mount D and NFS do firewall CMD dash dash add service
$I dash dash permanent. Done. And firewall CMD dash dash reload. Because I've just written
to the persistent configuration and we need to activate. So show mount minus E on local
host. Is that working? Yes, it is working. So now let's go to server one and verify that
there it works as well. And if it does complete our work. So now on server one, let's also
test show mount minus E on server two. And there we can see that homes is available.
All right. So now auto FS DNF install minus y auto FS. And what are we going to do in
auto FS? Well, we need to create ETC auto dot master. We need to create a line in there.
And that line is going to be slash homes. And we put it in ETC auto dot homes. And what
exactly are we going to do in slash homes? Well, that is further specified in ETC auto
dot homes. Where I'm going to refer to star. And when we have star minus RW, we go to server
two colon slash homes slash ampersand. And that should be doing it. The wildcard mount.
Let's not forget system CTL enable minus minus now auto FS.
And then I'm going into homes and in homes, I'm going into user one. And there we can see a couple
of kernel messages that are shown on the screen. But most important, my current directory is now
user one. And now it is user two. And that proves that the auto FS is working.