Hey guys and welcome back. In the previous nugget we had talked about some of the configuration
files that we could use to ultimately display user notifications. What we're now going to
do is to see what those files actually look like. So what I'm going to do here is I'm
going to go to my terminal and I will open up the first file which would be the Etsy
issue file. In fact I'll do this with super user privileges and I'll type in my password.
So now we see this configuration file we actually see Ubuntu, we see the version long term supports
and we see these special characters backslash n backslash l. Now we talked about these special
characters and these are ultimately going to represent different values. Now what I can
do here is I can actually modify this particular file. So what I'll do is I'll just say hello
there please login and again let's maybe change this value from backslash n maybe we'll say
backslash r and we'll also do backslash t for the time. Okay so if I just write this out
and I escape what I want to do is I want to get my login screen. Now remember this is
going to be a pre login we're not going to see after login and crucially this is not
going to be seen over the network. So I open up my putty session let's open this up notice
that we don't actually see this pre login message here we just have our login prompts
let me close this down. What I will do here is I will actually change the run level to
run level 3 which will just be a command line interface this will now restart the system
and look at this we actually see the exact message that we changed within that configuration
file we see that hello there we also see the time so on so forth now we can login so I'll
say ipv0 type in my password hit enter and now that I've logged in we see the post login
message so what I will do is I'll just change the run level back to run level 5 so hit enter
type in my password and we'll get our graphical user interface back there we go let's just
log back in but like I say we didn't actually see this pre login banner over ssh so what
we're going to do is we're going to make a modification to that ssh configuration file
remember we talked about that so I'll say sudo nano ssh ssh d underscore config and hit
enter type in the password now what I'm going to do is I'm going to scroll all the way down
till I see my banner right here I'm going to uncomment this and I'm going to change
the value none and I'm going to now specify that the banner should look in sssh.net so
now my ssh configuration is now pointing to this particular file what I'm now going to
do is I'm going to modify this file so I'll say issue.net and what I will do I'll just
delete this and say welcome to CBT Nuggets system please login okay so let's just save
you and I'll escape and now what I'm going to have to do to make this actually operational
is I'm going to have to restart my ssh config so what we'll say is sudo system CTL restart
ssh d this will reload that configuration file so now what I'll do is I'll go to login
via ssh I'll get my putty session let's open this up now when I type in my login username
as ipv0 we actually see this pre authentication banner you see that right here even though
I've not actually logged in so what I will do is I'll type in my password right now and
if I hit enter now we actually log into the system so before we logged in we get this
message right here and after we authenticate we get the post message so if we want to modify
what we see after the login like I say we can modify the etsemotd banner or the etsemotd
configuration file so what I'll do is I'll say sudo nano etsemotd and I'll just say congrats
on logging in have a great day at work there we go so let's save this and what I will do
put up putty okay let's login with my password hit enter notice now what we actually see here
we can see indeed we have our message of the day congrats on logging in have a great day
at work now these are ultimately automated messages they are generated when someone logs
in automatically from these configuration files however if we just want to send a message
to everyone on the system what we can do is use the wall command so what I could see here
is a wall and then I could broadcast backing up the system tomorrow please do local backups
now if I hit enter this is just going to display this message right here but the key thing to note
here is this is actually a broadcast message now as it transpires I only have the user ipv0 on the
system but if you imagine there were 10 different users all logged on to the system this message
here using the wall command is going to be broadcast to absolutely everyone so this is a good way to
send messages to the entire user base when you have to communicate something on the fly and like
I say it tells you who the message came from and it will be displayed to all different users so as
we can see here we have these different configuration files that we can use to ultimately send
particular messages either pre-login or post-login as well as messages for local logins as well as
messages for remote logins such as over SSH and we also have the wall command to allow us to send
messages to all users on the system on the fly as we see fit okay doc so that is us for understanding
user notifications I hope this has been informative for you and I'd like to thank you for viewing