Results 1 to 3 of 3

Thread: Server MOTD

  1. #1
    Join Date
    Jan 2006
    Location
    United States
    Posts
    1,385

    Server MOTD

    I have a question I wanted to ask some of you. I provide shell's at Host Phenom and I want to make some things in the motd when a client logs into there shell bold and add a few colors here and there.

    Is a motd on a box only allowed plain text or is bold allowed, colors allowed, etc... If so, can someone please tell me the code to use for:

    Bold
    Blue
    Turquoise type color

    Also, I am using SSH Secure Shell in order to access the shell's/root. There are no colors. I want to make a certain color for a folder, a certain color for an executable file, a certain color for a txt file, and so on. Can someone also explain to me how to do this.

    I think, but am not sure but will test that with FreeBSD it does the folder coloring itself, so I am going to download PuTTy which supports colors and see if this is right. But if someone can tell me how to place certain colors to certain types of files also that would be great.


    Regards,
    Last edited by TheChemist; 05-05-2008 at 03:39 PM.

  2. #2
    Join Date
    Apr 2003
    Location
    San Jose, CA.
    Posts
    1,622
    Just be aware that your motd is going to display screwy for anyone that doesn't support the ansi color codes you're using...

    In general use vi/vim to edit your motd.

    The only real key you need to know is how to insert an escape character ^[ : <Ctrl+V><press 2><press7>
    27 being the ascii code for ESC.

    Then the format is:
    ^[[##;##mtext^[[00m

    Broken into parts that's
    1) ^[
    2) [
    3) color;codes
    4) m
    5) text
    6) ^[
    7) [00m

    codes can be seen http://en.wikipedia.org/wiki/ANSI_escape_code

    So:

    To do red text:
    ^[[00;31mtext^[[00m

    Or bright red:
    ^[[01;31mtext^[[00m
    Daved @ Lightwave Networking, LLC.
    AS1426 https:/www.lightwave.net
    Primary Bandwidth: EGIHosting (NLayer, NTT, HE, Cogent)
    Xen PV VPS Hosting

  3. #3
    Join Date
    Apr 2003
    Location
    San Jose, CA.
    Posts
    1,622
    Quote Originally Posted by HostPhenom View Post
    Also, I am using SSH Secure Shell in order to access the shell's/root. There are no colors. I want to make a certain color for a folder, a certain color for an executable file, a certain color for a txt file, and so on. Can someone also explain to me how to do this.
    You need to use GNU ls for this to work:

    edit .bashrc file:

    Code:
    LS_COLORS='no=00:fi=00:di=01;37:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:';
    export LS_COLORS
    change as desired.
    Last edited by Lightwave; 05-05-2008 at 04:30 PM.
    Daved @ Lightwave Networking, LLC.
    AS1426 https:/www.lightwave.net
    Primary Bandwidth: EGIHosting (NLayer, NTT, HE, Cogent)
    Xen PV VPS Hosting

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •