HOWTO: Use the banner (banner.c) Command To Create Login Banners

| No TrackBacks
If you like ASCII art as much as I do, you might be interested to know that you can create your own ASCII art banners using the banner command on UNIX/Linux.  You can create banners like this:

                          #
 ####    #   #   ####    ##
#         # #   #       # #
 ####      #     ####     #
     #     #         #    #
#    #     #    #    #    #
 ####      #     ####   #####

I pipe the output of banner to /etc/motd so the banner message is displayed when users login.  If you need information on what /etc/motd (Mesage of the Day) is and how it works, see this SCO Group page for details.  Continue reading for the banner source.
For Linux, you can find the banner source here:  banner.c.gz

Compile the source using gcc:

#/>  gunzip banner.c.gz
#/>  gcc -o banner banner.c
#/>  ./banner cool

 ####    ####    ####   #
#    #  #    #  #    #  #
#       #    #  #    #  #
#       #    #  #    #  #
#    #  #    #  #    #  #
 ####    ####    ####   ######

To make the banner your M.O.T.D. (/etc/motd), as root run:

(root)#/>  ./banner system name | tee -a /etc/motd

For Solaris, you can find the source here.

On HP-UX, banner is already built and installed with the core OS.  For Perl nuts, there's actually a Perl version of banner on CPAN (Banner.pm).

Did You Find this Helpful?

Did you find this post helpful, or at least, interesting?

  

About Mark

A Silicon Valley native, Mark Kolich is a full-time Software Engineer and a consultant for hire. A web technologies expert, his current focus is on building powerful and robust cloud-driven web-applications using Java, PHP, Perl, AJAX, DHTML, CSS, and JavaScript. His favorite programming languages are PHP, Java and JavaScript. He uses Linux, enjoys biking to work, loves building great software, and always writes elegant, readable, and maintainable code.

No TrackBacks

No trackbacks attached to this entry.

Twitter (@markkolich)

Translate

About this Entry

This page contains a single entry by Mark Kolich published on November 5, 2008 9:29 AM.

HOWTO: Disable Linux Screen Blanking (Disable Powersave) was the previous entry in this blog.

Google AJAX Libraries API (googleapis.com Hosts Your Favorite Library) is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.