A message-of-the-day with color. Why? Just because.
Here's a MOTD shell script, containing modified verbiage from the US Government's official MOTD banner (blog photo makes sense now, doesn't it?). You can't just copy this into the MOTD file under /etc/motd
, you have to let the shell script write the file for you:
#!/bin/sh
#
#
# SSH issue filename
MOTD="/etc/motd"
# Text Color Variables
BLK="\033[00;30m" # BLACK
R="\033[00;31m" # RED
GRN="\033[00;32m" # GREEN
BR="\033[00;33m" # BROWN
BL="\033[00;34m" # BLUW
P="\033[00;35m" # PURPLE
C="\033[00;36m" # CYAN
LtG="\033[00;37m" # LIGHT GRAY
DkG="\033[01;30m" # DARK GRAY
LtR="\033[01;31m" # LIGHT RED
LtGRN="\033[01;32m" # LIGHT GREEN
Y="\033[01;33m" # YELLOW
LtBL="\033[01;34m" # LIGHT BLUE
LtP="\033[01;35m" # LIGHT PURPLE
LtC="\033[01;36m" # LIGHT CYAN
W="\033[01;37m" # WHITE
RESET="\033[0m"
clear > $MOTD # removes all text from /etc/motd
# Create MOTD
echo -e "" >> $MOTD
echo -e $R"You are accessing a Private System (PS)" >> $MOTD
echo -e "that is provided for authorized use only." >> $MOTD
echo -e "" >> $MOTD
echo -e $C"By using this PS (which includes any device attached to this PS)," >> $MOTD
echo -e "you consent to the following conditions:" >> $MOTD
echo -e $LtGRN'-'$W"The routine intercepts and monitoring of communications on this" >> $MOTD
echo -e "PS for purposes including, but not limited to, penetration testing," >> $MOTD
echo -e "COMSEC monitoring, network operations and defense, personnel" >> $MOTD
echo -e "misconduct (PM), law enforcement (LE), and counterintelligence (CI)" >> $MOTD
echo -e "investigations." >> $MOTD
echo -e $LtGRN'-'$W"At any time, the owner may inspect and seize data stored on this PS." >> $MOTD
echo -e $LtGRN'-'$W"Communications using, or data stored on, this PS are not private," >> $MOTD
echo -e "are subject to routine monitoring, interception, and search, and" >> $MOTD
echo -e "may be disclosed or used for any authorized purpose." >> $MOTD
echo -e $LtGRN'-'$W"This PS includes security measures (e.g., authentication and access" >> $MOTD
echo -e "controls) to protect the owner's interests--not for your personal benefit or" >> $MOTD
echo -e "privacy." >> $MOTD
echo -e $LtGRN'-'$W"Notwithstanding the above, using this PS does not constitute" >> $MOTD
echo -e "consent to PM, LE or CI investigative searching or monitoring of" >> $MOTD
echo -e "the content of privileged communications, or work product, related" >> $MOTD
echo -e "to personal representation or services by attorneys, psychotherapists," >> $MOTD
echo -e "or clergy, and their assistants. Such communications and work product" >> $MOTD
echo -e "are private and confidential." >> $MOTD
echo -e "" >> $MOTD
echo -e $W'###################################################################' >> $MOTD
echo -e $R" WARNING: Unauthorized access to this system is forbidden and will" >> $MOTD
echo -e " be prosecuted by law. By accessing this system, you agree that" >> $MOTD
echo -e " your actions may be monitored if unauthorized usage is suspected." >> $MOTD
echo -e $W'###################################################################' >> $MOTD
echo -e "" >> $MOTD
echo -e "" $RESET >> $MOTD
And here's what it looks like:
The next version will hopefully leverage a loop and use printf
when I get a chance to clean this up.