Importance of Adding Banners and MOTD (Demo)

Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
or

Already have an account? Sign In »

Time
21 hours 25 minutes
Difficulty
Intermediate
CEU/CPE
21
Video Transcription
00:00
>> Hey Cybrarians, welcome back to
00:00
the Linux Plus course here at Cybrary.
00:00
I'm your instructor Rob Goelz and in today's lesson,
00:00
we're going to cover adding banner messages.
00:00
Upon completion of today's lesson,
00:00
you're going to be able to understand
00:00
how banner messages are beneficial,
00:00
why we might want to use them.
00:00
We're also going to configure a Linux system
00:00
to display a banner or a message at
00:00
login on a console or terminal
00:00
and we're going to see how to do
00:00
that during our demo today.
00:00
If you ever received a disclaimer message when you
00:00
connected to a system
00:00
like a warning message or something,
00:00
that just means congratulations,
00:00
you've seen a banner message,
00:00
you know what we're talking about.
00:00
Now these can be provided to give
00:00
a legal disclaimer about the use of the system.
00:00
That's usually verbiage that you're
00:00
>> actually going to get
00:00
>> from the legal department and you'll add on the system.
00:00
Alternatively, sometimes they can
00:00
provide helpful information about the system.
00:00
We see an example of a legal
00:00
warning message in the upper right.
00:00
Some systems, especially hobbyist
00:00
systems like Raspberry Pi systems,
00:00
any of those kind of flavors of Pi,
00:00
they display ASCII art in their messages.
00:00
We can see that on
00:00
the bottom right-hand side, pretty cool,
00:00
along with a bunch of just general information
00:00
that's helpful to know about the system.
00:00
There are two places that you can set
00:00
a message to the user that's logging in.
00:00
You could use /etc/login.warn or /etc/issue.
00:00
What that does is it displays
00:00
the contents before the login prompt.
00:00
As soon as you connect to the system,
00:00
you get on to a terminal, you're going to see that.
00:00
Its generally uses a warning or legal disclaimer.
00:00
We want people to know about this
00:00
before they login for legal reasons.
00:00
Hey, this is this kind of system
00:00
and we have an acceptable use policy in
00:00
place so please don't mess around or we're going to
00:00
sue you or whatever you want
00:00
to say in that legal message.
00:00
Again, not a lawyer,
00:00
you're probably going to get that
00:00
from the legal department
00:00
but the other option is to use
00:00
the /etc/motd which stands for message of the day.
00:00
These messages are contents
00:00
they get displayed after login.
00:00
Someone's already logging in,
00:00
we're not going to give them a warning again,
00:00
they should have gotten the warning up front.
00:00
These are generally just used for
00:00
informational messages about the system.
00:00
We can see an example of
00:00
that over here on the right-hand side.
00:00
Let's see how to configure both of
00:00
these with some demo time.
00:00
Here we are in our demo environment.
00:00
Today, we're back here in CentOS 8.
00:00
Let's configure that warning message first.
00:00
Now we could do it in CentOS by editing /etc/issue.
00:00
We're going to do a pseudo edit on
00:00
/etc/issue or /etc/issue rather I should say sorry.
00:00
Issue, no issues.
00:00
I'm going to pop in
00:00
my password here to temporarily become
00:00
root and we can see that we
00:00
basically have no information in here.
00:00
It's going to get some information about the system,
00:00
the kernel, all that good stuff
00:00
but this has barely anything.
00:00
Like we said that we want this
00:00
>> to be a legal disclaimer.
00:00
>> Luckily for us, I already
00:00
have an example of this that I created.
00:00
What I'm going to do is I'm going to copy over
00:00
my copy of this from /etc/issue.bak,
00:00
which is the file name that I gave it and we're going
00:00
to copy this and overwrite /etc/issue.
00:00
Now we can go back into that file with pseudo edit and
00:00
we can see that we've got lot more information in here.
00:00
The system has used the property of
00:00
Bogus Corp for the authorized use only.
00:00
We have an acceptable use policy.
00:00
We expect that you abide by it.
00:00
All this stuff on here is audited so
00:00
don't expect any privacy, et cetera.
00:00
Let's go ahead now reboot
00:00
this system so we can see the message.
00:00
We're going to go ahead and do a wq out of this file.
00:00
Although we didn't really write anything,
00:00
we'll just do that to be safe.
00:00
I'm going to do a pseudo reboot.
00:00
Now this is going to reboot the system.
00:00
It's going to bring us back to a login screen.
00:00
Once we get back to the login screen,
00:00
what we're going to do is we're going to change
00:00
to a text-based login.
00:00
We'll just give it a minute here while that happens.
00:00
While we're waiting for this to come up,
00:00
let's see if we can get into that other login window
00:00
just in a second here.
00:00
I've connected over to
00:00
the text-based login and once it
00:00
comes up here and allows us to log in the system,
00:00
we should see what we want to see.
00:00
Let's actually change to that again.
00:00
Here we go. Now, because we're in the text-based login,
00:00
we see this warning message right from the outset.
00:00
This system is the property of Bogus Corp et cetera.
00:00
All the stuff that we put into our /etc/issue file.
00:00
Wonderful. Now let's go ahead and log in.
00:00
I'm just going to log in as me on
00:00
the system and I'm logged in here and I'm going
00:00
to do Control L to clear the screen.
00:00
Now what we can do is we can
00:00
actually go ahead and set up the motd.
00:00
For right now I actually don't have anything in motd.
00:00
We can do an /etc/motd and we
00:00
can see that that file is empty
00:00
[NOISE] but what I can do instead is
00:00
I can actually just go ahead and
00:00
copy over one that I have created.
00:00
I'll do a pseudo cp.
00:00
We're going to do pseudo copy of etc and I
00:00
call this motd.bak for back.
00:00
I'm going to write over /etc/motd.
00:00
Now if we go ahead and do a pseudo edit on /etc/motd,
00:00
we see that we've got a cool little ASCII penguin and
00:00
information about Bogus Corp
00:00
and the great Spider-Man line,
00:00
"Remember with great power comes great responsibility."
00:00
Excellent. We'll go ahead and quit out of this file.
00:00
Now what we'll see if we do
00:00
an SSH localhost on this system,
00:00
we're going to see this message [NOISE]. There we go.
00:00
We're on the system and we have a message,
00:00
an informational message about the system with
00:00
the information about the last time we logged
00:00
in and our cool looking ASCII penguin.
00:00
With that, we've reached the end of this lesson.
00:00
In this lesson we covered how
00:00
banner messages are beneficial
00:00
>> for providing disclaimer,
00:00
>> warning or information and then
00:00
we saw in the demo how we can configure
00:00
Linux to display a banner or a warning message at
00:00
login on a console or terminal.
00:00
With that, we've reached the end of this lesson.
00:00
Thanks so much for being here and I look
00:00
forward to seeing you in the next lesson.
Up Next