Hey guys and welcome back.
So to wrap up this skill on network troubleshooting, there are a couple more things I want to
talk to you about.
The first one relates to host name configuration.
Now this could very well have fallen under the topic of network configuration files because
you can actually change the configuration directly via a particular configuration file.
However there are actually different ways to change this particular value.
So let's begin with that first.
So if I just actually issue the command host name, this is going to print out well my host
name.
What we can actually do here is we can indeed change the name of our host name and we can
do it directly with this command.
We can just say host name and let's just call this maybe John's computer and if I hit enter.
Oh of course I have to be the super user so I'll just change this to John's computer
with super user type in my password.
Now it might not be apparent but my host name has actually been changed.
If I happen to say host name we can see here the name has changed.
Now if I would happen to get a new shell i.e. by logging in once again or by going directly
to my machine.
So while those will close this one down I will get a new terminal.
Notice here the name has indeed changed.
Similarly if I happen to close my SSH session and I open a new putty session.
If I log in as IPv0 type in my password you can see indeed just the same way the host
name has changed to John's computer.
Now the big thing here though is that this configuration change.
This configuration change is not persistent meaning that if I happen to reboot my machine
this change would just be undone i.e. we would revert back to the original host name.
So let's just test this out.
I can say sudo reboot type in my password that kills the connection.
Now my machine is rebooting.
Ok so if I log in I just full screen this.
If I go to my terminal notice it has reverted back to IPv0 and I say host name with the
command once again it has reverted.
Now if I want to make this change persistent I can actually modify a particular configuration
file.
Now that file again is in the Etsy directory and it's called host name really easy to
remember.
The difference here is that if I happen to modify the host name directly within this
configuration file that change will be persistent i.e. meaning that if I happen to reboot my
system the new host name will still stay in place.
So what I can do here is if I show you this particular file and I say sudo nano etsy and
go into host name hit enter.
We can see here the host name has been set to IPv0.
If we want to make a modification to this particular configuration file we can actually
do so directly via the command line.
The difference is that we don't use the command host name we actually use the command host
name CTL and by doing this this will actually modify that particular file.
So I'll say sudo host name CTL and I can say set hyphen host name and change this to
maybe say john test.
Now if I hit enter again it appears like nothing has actually changed here but if I say host
name now the name has indeed been changed to john test and if I go back into this configuration
file and I hit enter notice this configuration file has been updated.
Now like I say this here doesn't appear like it's changed within the prompt that is because
we're still using the same shell.
If I happen to close this down and open up a new terminal window indeed we see john test
instead and again if I happen to say sudo reboot and reboot the system hit enter the system
reloads the system has rebooted let's log back in we'll open up a terminal let's go in.
Notice this time the changes though have actually survived the reboot that is because when we
use the host name command itself we do not actually modify the etsy host name configuration
file however when we use the host name CTL command we do indeed modify that configuration
file and that makes all the difference with respect to the persistence of this particular
configuration.
So that is something we have to know for the lpik 2 examination.
Now before we close I just want to make note of two very important files both within the
etsy directory one is called hosts.allow and the other is hosts.deny.
Now we actually have this concept of what is called a TCP wrapper okay.
Now all TCP wrappers refer to are particular programs that happen to be compiled with something
called libwrap.
Try to remember that and all libwrap is is a very particular library.
Now this library happens to be used by things such as say SSH because the SSH server daemon
i.e. SSHD will use this particular library.
Now when something like say SSHD happens to want to use libwrap in order to be able to
authorize a particular connection it's first going to look in etsy host.allow and if from
within this file it sees that this particular service is allowed to be made to this particular
network or destination then that connection will indeed be allowed to happen.
Now if no rule within this particular file happens to be found and matched the libwrap
library is going to look at particular rules within the other file etsy host.deny and if
we happen to get a match within this particular file then the libwrap library is going to say
to that service this connection is not allowed and quite simply if we happen to have no match
in either file then the libwrap library is going to tell that particular service be SSHD
to indeed allow this access.
But again we do want to understand the order of operations here.
The first place it will look like I say will be in etsyhost.allow and right now this particular
configuration is blank but you might actually see something like say the service SSHD followed
by a colon and then you could specify a particular destination or you could give a network range
or indeed you could say the keyword all which would mean that for the SSHD daemon all connections
are going to be allowed or we could specify particular keywords such as accept and we
can add in a particular host to not allow say for example 0.50 this would mean that for this
particular daemon we would allow absolutely everyone to use SSHD except for this particular host in
which case they would be disallowed. Now again if we do not happen to find a match within this
particular file the next file we would go to would be an etsyhost.deny. The difference here being
is if we go in let me just escape out and I go into hosts.deny if I happen to say SSHD and then
specify all as opposed to allowing everyone access to SSHD instead we are denying them access because
we are now in the deny file. Now one thing to say is that if we happen to have a conflict i.e.
we happen to allow a particular service within hosts.allow but we have actually got a similar rule
within hosts.deny disallowing a particular service for a particular connection the one that is going
to take precedence and when is going to be the hosts.allow file that will override anything within
hosts.deny the reason being here is that hosts.allow that particular file is going to be evaluated
first so if that happens to find a match within that file the hosts.deny file will not even be
checked. Ok doc so that can be a little bit confusing but it certainly is worthwhile to remember
for the purposes of the examination these tcp wrappers are going to use that libwrap library
in that particular library is going to check these particular configuration files
when these particular services are going to be called to be used say for example our network
connection over ssh libwrap will consult these particular files and being able to control access
to these particular files can have a great impact on these network connections and understanding this
is going to have a profound effect with your ability to diagnose these types of problems and
fix these types of network connection issues so that is us for our network troubleshooting
i hope this has been informative for you and i'd like to thank you for viewing