Question : During the monthly compliance meeting, it was pointed out that several servers in the Stratos DC do not have a valid banner. The security team has provided serveral approved templates which should be applied to the servers to maintain compliance. These will be displayed to the user upon a successful login.
1. Copy the /tmp/nautilus_banner using scp command from jumpserver to
all Apps & DB servers.
thor@jump_host
/$ ll /tmp/nautilus_banner -rw-r--r-- 1
root root 2531 Jun 26 15:39 /tmp/nautilus_banner thor@jump_host
/$ thor@jump_host
/$ scp -r /tmp/nautilus_banner tony@stapp01:/tmp The authenticity
of host 'stapp01 (172.16.238.10)' can't be established. ECDSA key
fingerprint is SHA256:C1wj96Q8FEfYPlCvtHftglN5KEYSvaAhbi3hmWcXF/U. ECDSA key
fingerprint is MD5:09:36:49:a3:00:da:35:72:e7:b2:2a:97:dd:f3:01:8d. Are you sure you
want to continue connecting (yes/no)? yes Warning:
Permanently added 'stapp01,172.16.238.10' (ECDSA) to the list of known hosts. tony@stapp01's
password: nautilus_banner 100%
2531 2.3MB/s 00:00
thor@jump_host
/$ |
2. Login to all the App server & switch to root user
thor@jump_host
/$ ssh tony@stapp01 tony@stapp01's
password: [tony@stapp01
~]$ sudo su - We trust you have received the usual lecture from the local System Administrator.
It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great
responsibility. [sudo] password for tony: [root@stapp01 ~]# mv /tmp/nautilus_banner /etc/motd mv: overwrite
‘/etc/motd’? yes [root@stapp01
~]# |
thor@jump_host
/$ ssh tony@stapp01 tony@stapp01's
password: Last login: Sat
Jun 26 15:46:03 2021 from jump_host.linux-banner_app_net ################################################################################################ .__
__. ___ __
__ .___________. __ __
__ __ _______. # |
\ | | /
\ | |
| | | ||
| | | |
| | |
/ | # | \|
| / ^
\ | |
| | `---| |----`|
| | | |
| | |
| (----` # |
. ` | /
/_\ \ |
| | |
| | |
| | | |
| | |
\ \ # |
|\ | /
_____ \ | `--'
| | |
| | | `----.|
`--' | .----) |
# |__| \__| /__/ \__\ \______/ |__|
|__| |_______| \______/
|_______/ #
# #
#
# # # ( )
#
___#_#___|__
# _ |____________| _
# _=====| | | | | |==== _ # =====|
|.---------------------------. | |==== # <--------------------' .
. . .
. . .
. '--------------/ # \
/ #
\_______________________________________________WWS_________/ #
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww # wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww # wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww #
#
# ################################################################################################ Warning! All
Nautilus systems are monitored and audited. Logoff immediately if you are not
authorized! [tony@stapp01
~]$ |
1. Login on DB server & Install openssh-clients
thor@jump_host
/$ ssh peter@stdb01 The authenticity
of host 'stdb01 (172.16.239.10)' can't be established. ECDSA key
fingerprint is SHA256:4DArb3ojuPQXjniJ6ju3HtFHQp+PtG8CVN0qP39Lsyo. ECDSA key
fingerprint is MD5:81:1a:82:8a:53:14:a7:dd:61:49:3f:0f:59:73:47:89. Are you sure you
want to continue connecting (yes/no)? yes Warning:
Permanently added 'stdb01,172.16.239.10' (ECDSA) to the list of known hosts. peter@stdb01's
password: [peter@stdb01
~]$ sudo su - We trust you have received the usual lecture from the local System Administrator.
It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great
responsibility. [sudo] password for peter: [root@stdb01 ~]# |
thor@jump_host
/$ scp -r /tmp/nautilus_banner peter@stdb01:/tmp peter@stdb01's
password: nautilus_banner
nautilus_banner
100%
2531 3.2MB/s 00:00
thor@jump_host
/$ |
[root@stdb01 ~]#
mv /tmp/nautilus_banner /etc/motd mv: overwrite
‘/etc/motd’? yes [root@stdb01 ~]# |
thor@jump_host
/$ ssh peter@stdb01 peter@stdb01's
password: Last login: Sat
Jun 26 15:53:55 2021 from jump_host.linux-banner_db_net ################################################################################################ .__
__. ___ __
__ .___________. __ __
__ __ _______. # |
\ | | /
\ | |
| | | ||
| | | |
| | |
/ | # |
\| | /
^ \ |
| | | `---|
|----`| | | |
| | |
| | (----`
# |
. ` | /
/_\ \ |
| | |
| | |
| | | |
| | |
\ \ # |
|\ | /
_____ \ | `--'
| | |
| | | `----.|
`--' | .----) |
# |__| \__| /__/ \__\ \______/ |__|
|__| |_______| \______/
|_______/ # #
#
#
# # # ( )
# ___#_#___|__
# _ |____________| _
# _=====| | | | | |==== _ # =====| |.---------------------------.
| |====
# <--------------------' .
. . .
. . .
. '--------------/ # \
/ #
\_______________________________________________WWS_________/ #
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww # wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww #
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww #
#
# ################################################################################################ Warning! All
Nautilus systems are monitored and audited. Logoff immediately if you are not
authorized! [peter@stdb01
~]$ |
Happy Learning!!!!
Apart from this if you need more clarity, I have made a tutorial video on this , please go through and share your comments. Like and share the knowledge
9 Comments
Make use of the approved template located at /root/nautilus_banner on jump host,....,, He is saying file in /root/nautilus but you using /tmp directory I didn't get clear about /tmp/nautilus_banner this directory you use
ReplyDeleteThanks for your comment. I copied the update task question for reference. which cause you confusion. If you would gone through the video you would notice in previous task location was /tmp/nautilus. Which now change to /root /nautilus_banner. Please go through the update version of task and follow the same steps.
DeleteThank you
ReplyDeleteYou Welcome. Keep Learning
DeleteHello, thanks for your help. Please how do you connect to stdb server?
ReplyDeleteDone the same steps as you mentioned, even given the executable permission to /etc/motd, still it didnt work.
ReplyDeletehope you doing on the correct server. could you please share me task will validate. or connect me online chat while performing task . will help you.
Deleteit worked now but i have to edit /etc/ssh/sshd_config where i have to uncomment banner and need to add file path (banner one)..and restarted the sshd service.
DeleteGlad to know you solve by own and troubleshoot. Thanks for updating. Keep Learning
Delete