Linux修改/etc/motd自定义登陆欢迎界面

主机教程评论813字数 12322阅读41分4秒阅读模式

首先上一张测试图:

Linux修改/etc/motd自定义登陆欢迎界面文章源自国外主机测评-https://www.zjcp.org/14840.html

这是一张一“Doge”为例的欢迎界面,是不是有点炫酷,修改方法比较简单:文章源自国外主机测评-https://www.zjcp.org/14840.html

直接连接FTP或SFTP,找到/etc/motd,直接覆盖内容,重新连接ssh即可看到效果。文章源自国外主机测评-https://www.zjcp.org/14840.html

大家可以根据自己的喜好进行修改,要自定义图片的话可以使用“在线图片转化成ASCII字符串工具”将图片转为ASCII,然后覆盖motd。文章源自国外主机测评-https://www.zjcp.org/14840.html

在线图片转化成ASCII字符串工具:文章源自国外主机测评-https://www.zjcp.org/14840.html

  1. 支持图片转ASCII(中文界面):http://www.atool9.com/img2ascii.php
  2. 支持图片和文字转ASCII(英文界面):https://www.ascii-art-generator.org
  3. 支持图片和文字转ASCII(英文界面):https://www.degraeve.com/img2txt.php

这里提供几个现成的案例(带有中文字符的需要系统支持中文词库,否则中文变乱码)文章源自国外主机测评-https://www.zjcp.org/14840.html

①Doge文章源自国外主机测评-https://www.zjcp.org/14840.html

/**                                                                          
 *          .,:,,,                                        .::,,,::.          
 *        .::::,,;;,                                  .,;;:,,....:i:         
 *        :i,.::::,;i:.      ....,,:::::::::,....   .;i:,.  ......;i.        
 *        :;..:::;::::i;,,:::;:,,,,,,,,,,..,.,,:::iri:. .,:irsr:,.;i.        
 *        ;;..,::::;;;;ri,,,.                    ..,,:;s1s1ssrr;,.;r,        
 *        :;. ,::;ii;:,     . ...................     .;iirri;;;,,;i,        
 *        ,i. .;ri:.   ... ............................  .,,:;:,,,;i:        
 *        :s,.;r:... ....................................... .::;::s;        
 *        ,1r::. .............,,,.,,:,,........................,;iir;        
 *        ,s;...........     ..::.,;:,,.          ...............,;1s        
 *       :i,..,.              .,:,,::,.          .......... .......;1,       
 *      ir,....:rrssr;:,       ,,.,::.     .r5S9989398G95hr;. ....,.:s,      
 *     ;r,..,s9855513XHAG3i   .,,,,,,,.  ,S931,.,,.;s;s&BHHA8s.,..,..:r:     
 *    :r;..rGGh,  :SAG;;G@BS:.,,,,,,,,,.r83:      hHH1sXMBHHHM3..,,,,.ir.    
 *   ,si,.1GS,   sBMAAX&MBMB5,,,,,,:,,.:&8       3@HXHBMBHBBH#X,.,,,,,,rr    
 *   ;1:,,SH:   .A@&&B#&8H#BS,,,,,,,,,.,5XS,     3@MHABM&59M#As..,,,,:,is,   
 *  .rr,,,;9&1   hBHHBB&8AMGr,,,,,,,,,,,:h&&9s;   r9&BMHBHMB9:  . .,,,,;ri.  
 *  :1:....:5&XSi;r8BMBHHA9r:,......,,,,:ii19GG88899XHHH&GSr.      ...,:rs.  
 *  ;s.     .:sS8G8GG889hi.        ....,,:;:,.:irssrriii:,.        ...,,i1,  
 *  ;1,         ..,....,,isssi;,        .,,.                      ....,.i1,  
 *  ;h:               i9HHBMBBHAX9:         .                     ...,,,rs,  
 *  ,1i..            :A#MBBBBMHB##s                             ....,,,;si.  
 *  .r1,..        ,..;3BMBBBHBB#Bh.     ..                    ....,,,,,i1;   
 *   :h;..       .,..;,1XBMMMMBXs,.,, .. :: ,.               ....,,,,,,ss.   
 *    ih: ..    .;;;, ;;:s58A3i,..    ,. ,.:,,.             ...,,,,,:,s1,    
 *    .s1,....   .,;sh,  ,iSAXs;.    ,.  ,,.i85            ...,,,,,,:i1;     
 *     .rh: ...     rXG9XBBM#M#MHAX3hss13&&HHXr         .....,,,,,,,ih;      
 *      .s5: .....    i598X&&A&AAAAAA&XG851r:       ........,,,,:,,sh;       
 *      . ihr, ...  .         ..                    ........,,,,,;11:.       
 *         ,s1i. ...  ..,,,..,,,.,,.,,.,..       ........,,.,,.;s5i.         
 *          .:s1r,......................       ..............;shs,           
 *          . .:shr:.  ....                 ..............,ishs.             
 *              .,issr;,... ...........................,is1s;.               
 *                 .,is1si;:,....................,:;ir1sr;,                  
 *                    ..:isssssrrii;::::::;;iirsssssr;:..                    
 *                         .,::iiirsssssssssrri;;:.                      
 */

 文章源自国外主机测评-https://www.zjcp.org/14840.html

②Doge文章源自国外主机测评-https://www.zjcp.org/14840.html

/**
 *               ii.                                         ;9ABH,          
 *              SA391,                                    .r9GG35&G          
 *              &#ii13Gh;                               i3X31i;:,rB1         
 *              iMs,:,i5895,                         .5G91:,:;:s1:8A         
 *               33::::,,;5G5,                     ,58Si,,:::,sHX;iH1        
 *                Sr.,:;rs13BBX35hh11511h5Shhh5S3GAXS:.,,::,,1AG3i,GG        
 *                .G51S511sr;;iiiishS8G89Shsrrsh59S;.,,,,,..5A85Si,h8        
 *               :SB9s:,............................,,,.,,,SASh53h,1G.       
 *            .r18S;..,,,,,,,,,,,,,,,,,,,,,,,,,,,,,....,,.1H315199,rX,       
 *          ;S89s,..,,,,,,,,,,,,,,,,,,,,,,,....,,.......,,,;r1ShS8,;Xi       
 *        i55s:.........,,,,,,,,,,,,,,,,.,,,......,.....,,....r9&5.:X1       
 *       59;.....,.     .,,,,,,,,,,,...        .............,..:1;.:&s       
 *      s8,..;53S5S3s.   .,,,,,,,.,..      i15S5h1:.........,,,..,,:99       
 *      93.:39s:rSGB@A;  ..,,,,.....    .SG3hhh9G&BGi..,,,,,,,,,,,,.,83      
 *      G5.G8  9#@@@@@X. .,,,,,,.....  iA9,.S&B###@@Mr...,,,,,,,,..,.;Xh     
 *      Gs.X8 S@@@@@@@B:..,,,,,,,,,,. rA1 ,A@@@@@@@@@H:........,,,,,,.iX:    
 *     ;9. ,8A#@@@@@@#5,.,,,,,,,,,... 9A. 8@@@@@@@@@@M;    ....,,,,,,,,S8    
 *     X3    iS8XAHH8s.,,,,,,,,,,...,..58hH@@@@@@@@@Hs       ...,,,,,,,:Gs   
 *    r8,        ,,,...,,,,,,,,,,.....  ,h8XABMMHX3r.          .,,,,,,,.rX:  
 *   :9, .    .:,..,:;;;::,.,,,,,..          .,,.               ..,,,,,,.59  
 *  .Si      ,:.i8HBMMMMMB&5,....                    .            .,,,,,.sMr 
 *  SS       :: h@@@@@@@@@@#; .                     ...  .         ..,,,,iM5 
 *  91  .    ;:.,1&@@@@@@MXs.                            .          .,,:,:&S 
 *  hS ....  .:;,,,i3MMS1;..,..... .  .     ...                     ..,:,.99 
 *  ,8; ..... .,:,..,8Ms:;,,,...                                     .,::.83 
 *   s&: ....  .sS553B@@HX3s;,.    .,;13h.                            .:::&1 
 *    SXr  .  ...;s3G99XA&X88Shss11155hi.                             ,;:h&, 
 *     iH8:  . ..   ,;iiii;,::,,,,,.                                 .;irHA  
 *      ,8X5;   .     .......                                       ,;iihS8Gi
 *         1831,                                                 .,;irrrrrs&@
 *           ;5A8r.                                            .:;iiiiirrss1H
 *             :X@H3s.......                                .,:;iii;iiiiirsrh
 *              r#h:;,...,,.. .,,:;;;;;:::,...              .:;;;;;;iiiirrss1
 *             ,M8 ..,....,.....,,::::::,,...         .     .,;;;iiiiiirss11h
 *             8B;.,,,,,,,.,.....          .           ..   .:;;;;iirrsss111h
 *            i@5,:::,,,,,,,,.... .                   . .:::;;;;;irrrss111111
 *            9Bi,:,,,,......                        ..r91;;;;;iirrsss1ss1111
 */

③滑稽文章源自国外主机测评-https://www.zjcp.org/14840.html

/**                                                                    
 *            .,,       .,:;;iiiiiiiii;;:,,.     .,,                   
 *          rGB##HS,.;iirrrrriiiiiiiiiirrrrri;,s&##MAS,                
 *         r5s;:r3AH5iiiii;;;;;;;;;;;;;;;;iiirXHGSsiih1,               
 *            .;i;;s91;;;;;;::::::::::::;;;;iS5;;;ii:                  
 *          :rsriii;;r::::::::::::::::::::::;;,;;iiirsi,               
 *       .,iri;;::::;;;;;;::,,,,,,,,,,,,,..,,;;;;;;;;iiri,,.           
 *    ,9BM&,            .,:;;:,,,,,,,,,,,hXA8:            ..,,,.       
 *   ,;&@@#r:;;;;;::::,,.   ,r,,,,,,,,,,iA@@@s,,:::;;;::,,.   .;.      
 *    :ih1iii;;;;;::::;;;;;;;:,,,,,,,,,,;i55r;;;;;;;;;iiirrrr,..       
 *   .ir;;iiiiiiiiii;;;;::::::,,,,,,,:::::,,:;;;iiiiiiiiiiiiri         
 *   iriiiiiiiiiiiiiiii;;;::::::::::::::::;;;iiiiiiiiiiiiiiiir;        
 *  ,riii;;;;;;;;;;;;;:::::::::::::::::::::::;;;;;;;;;;;;;;iiir.       
 *  iri;;;::::,,,,,,,,,,:::::::::::::::::::::::::,::,,::::;;iir:       
 * .rii;;::::,,,,,,,,,,,,:::::::::::::::::,,,,,,,,,,,,,::::;;iri       
 * ,rii;;;::,,,,,,,,,,,,,:::::::::::,:::::,,,,,,,,,,,,,:::;;;iir.      
 * ,rii;;i::,,,,,,,,,,,,,:::::::::::::::::,,,,,,,,,,,,,,::i;;iir.      
 * ,rii;;r::,,,,,,,,,,,,,:,:::::,:,:::::::,,,,,,,,,,,,,::;r;;iir.      
 * .rii;;rr,:,,,,,,,,,,,,,,:::::::::::::::,,,,,,,,,,,,,:,si;;iri       
 *  ;rii;:1i,,,,,,,,,,,,,,,,,,:::::::::,,,,,,,,,,,,,,,:,ss:;iir:       
 *  .rii;;;5r,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,sh:;;iri        
 *   ;rii;:;51,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.:hh:;;iir,        
 *    irii;::hSr,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,sSs:;;iir:         
 *     irii;;:iSSs:.,,,,,,,,,,,,,,,,,,,,,,,,,,,..:135;:;;iir:          
 *      ;rii;;:,r535r:...,,,,,,,,,,,,,,,,,,..,;sS35i,;;iirr:           
 *       :rrii;;:,;1S3Shs;:,............,:is533Ss:,;;;iiri,            
 *        .;rrii;;;:,;rhS393S55hh11hh5S3393Shr:,:;;;iirr:              
 *          .;rriii;;;::,:;is1h555555h1si;:,::;;;iirri:.               
 *            .:irrrii;;;;;:::,,,,,,,,:::;;;;iiirrr;,                  
 *               .:irrrriiiiii;;;;;;;;iiiiiirrrr;,.                    
 *                  .,:;iirrrrrrrrrrrrrrrrri;:.                        
 *                        ..,:::;;;;:::,,.                             
 */

④佛主保佑

/**
 *                    _ooOoo_
 *                   o8888888o
 *                   88" . "88
 *                   (| -_- |)
 *                    O/ = /O
 *                ____/`---'/____
 *              .   ' //| |// `.
 *               / //||| : |||// /
 *             / _||||| -:- |||||- /
 *               | | /// - /// | |
 *             | /_| ''/---/'' | |
 *              / .-/__ `-` ___/-. /
 *           ___`. .' /--.--/ `. . __
 *        ."" '< `.___/_<|>_/___.' >'"".
 *       | | : `- /`.;`/ _ /`;.`/ - ` : | |
 *         / / `-. /_ __/ /__ _/ .-` / /
 * ======`-.____`-.___/_____/___.-`____.-'======
 *                    `=---='
 *
 * .............................................
 *          佛祖保佑             永无BUG
 */

⑤BUG

/**
 * _ooOoo_
 * o8888888o
 * 88" . "88
 * (| -_- |)
 *  O/ = /O
 * ___/`---'/____
 * .   ' //| |// `.
 * / //||| : |||// /
 * / _||||| -:- |||||- /
 * | | /// - /// | |
 * | /_| ''/---/'' | |
 * / .-/__ `-` ___/-. /
 * ___`. .' /--.--/ `. . __
 * ."" '< `.___/_<|>_/___.' >'"".
 * | | : `- /`.;`/ _ /`;.`/ - ` : | |
 * / / `-. /_ __/ /__ _/ .-` / /
 * ======`-.____`-.___/_____/___.-`____.-'======
 * `=---='
 *          .............................................
 *           佛曰:bug泛滥,我已瘫痪!
 */

⑥神兽保佑

/**
 *   ┏┓   ┏┓
 * ┏┛┻━━━┛┻┓
 * ┃       ┃
 * ┃   ━   ┃
 * ┃ >   < ┃
 * ┃       ┃
 * ┃... ⌒ ... ┃
 * ┃       ┃
 * ┗━┓   ┏━┛
 *     ┃   ┃ 
 *     ┃   ┃
 *     ┃   ┃
 *     ┃   ┃  神兽保佑
 *     ┃   ┃  代码无bug  
 *     ┃   ┃
 *     ┃   ┗━━━┓
 *     ┃       ┣┓
 *     ┃       ┏┛
 *     ┗┓┓┏━┳┓┏┛
 *       ┃┫┫ ┃┫┫
 *       ┗┻┛ ┗┻┛
 */

⑦攻城狮

/** 
 *             ,%%%%%%%%, 
 *           ,%%//%%%%//%% 
 *          ,%%%/c "" J/%%% 
 * %.       %%%%/ o  o /%%% 
 * `%%.     %%%%    _  |%%% 
 *  `%%     `%%%%(__Y__)%%' 
 *  //       ;%%%%`/-/%%%'
 * ((       /  `%%%%%%%' 
 *  //    .'          | 
 *   //  /       /  | | 
 *    ///         ) | | 
 *     /         /_ | |__ 
 *     (___________))))))) 攻城湿 
 * 
 *        _       _ 
 * __   _(_)_   _(_) __ _ _ __ 
 * / / / / / / / / |/ _` |'_ / 
 *  / V /| |/ V /| | (_| | | | | 
 *   /_/ |_| /_/ |_|/__,_|_| |_| 
 */

⑧掘金

/** 
 *    111                         1           
 *    111 111111111111           111          
 *    11  111111111111          11111         
 *    11  111       11         1111111        
 *  1111 1 11111111111         111 1111       
 *  111111 11111111111       1111   11111     
 *  111111 11               1111     111111   
 *    11   11111111 11    111111111111111111  
 *    11   11111111111   1111111111111111111  
 *    111111111 11  11    11      11          
 *  111111111111111111            11          
 *  1111  111111111111      11111111111111    
 *  1111  11    11          11111111111111    
 *    11  11 11 11  111      11   11  111     
 *    11  11 11 11  11       111  11  111     
 *    11 111 11 11  11        111 11 111      
 *  1111 111 111111111     11 111 11 1111111  
 *   111111  1111111111    11111111111111111  
 *   11 111         111    11111111111111111  
 */

⑨HIRE

/**
 * 
 *           _____                    _____                    _____                    _____          
 *          //    /                  //    /                  //    /                  //    /         
 *         /::/____/                /::/    /                /::/    /                /::/    /        
 *        /:::/    /                /:::/    /              /::::/    /              /::::/    /       
 *       /:::/    /                  /:::/    /            /::::::/    /            /::::::/    /      
 *      /:::/    /                    /:::/    /          /::://:::/    /          /::://:::/    /     
 *     /:::/____/                      /:::/    /        /:::/__/:::/    /        /:::/__/:::/    /    
 *    /::::/    /                      /::::/    /      /::::/   /:::/    /      /::::/   /:::/    /   
 *   /::::::/    /   _____    ____    /::::::/    /    /::::::/   /:::/    /    /::::::/   /:::/    /  
 *  /::://:::/    / //    /  //   /  /::://:::/    /  /::://:::/   /:::/____/  /::://:::/   /:::/    / 
 * /:::/  /:::/    /::/____//::/   //:::/  /:::/____//:::/  /:::/   /:::|    |/:::/__/:::/   /:::/____/
 * /::/    /:::/  /:::/    //:::/  /:::/    /::/    //::/   |::::/  /:::|____|/:::/   /:::/   /::/    /
 *  //____/ /::://:::/    /  /::://:::/    / //____/  //____|::::://:::/    /  /:::/   /:::/   //____/ 
 *           /::::::/    /    /::::::/    /                 |:::::::::/    /    /:::/   /:::/    /     
 *            /::::/    /      /::::/____/                  |::|/::::/    /      /:::/   /:::/____/    
 *            /:::/    /        /:::/    /                  |::| /::/____/        /:::/   /::/    /    
 *           /:::/    /          /:::/    /                 |::|  ~|               /:::/   //____/     
 *          /:::/    /            /:::/    /                |::|   |                /:::/    /         
 *         /:::/    /              /:::/____/               /::|   |                 /:::/____/        
 *         /::/    /                /::/    /                /:|   |                  /::/    /        
 *          //____/                  //____/                  /|___|                   //____/         
 */

⑩老鼠

/**
 * 
 *  .--,       .--,
 * ( (  /.---./  ) )
 *  '.__/o   o/__.'
 *     {=  ^  =}
 *      >  -  <
 *     /       /
 *    //       //
 *   //|   .   |//
 *   "'/       /'"_.-~^`'-.
 *      /  _  /--'         `
 *    ___)( )(___
 *   (((__) (__)))    高山仰止,景行行止.虽不能至,心向往之。
 */

⑪顶

/**
 * 頂頂頂頂頂頂頂頂頂 頂頂頂頂頂頂頂頂頂
 * 頂頂頂頂頂頂頂     頂頂     
 *    頂頂   頂頂頂頂頂頂頂頂頂頂頂
 *    頂頂   頂頂頂頂頂頂頂頂頂頂頂
 *    頂頂   頂頂       頂頂
 *    頂頂   頂頂  頂頂頂  頂頂
 *    頂頂   頂頂  頂頂頂  頂頂
 *    頂頂   頂頂  頂頂頂  頂頂
 *    頂頂   頂頂  頂頂頂  頂頂
 *    頂頂       頂頂頂 
 *    頂頂      頂頂 頂頂 頂頂
 *  頂頂頂頂   頂頂頂頂頂 頂頂頂頂頂
 *  頂頂頂頂   頂頂頂頂   頂頂頂頂
 */

⑫HatsuneMiku

               #########                       
              ############                     
              #############                    
             ##  ###########                   
            ###  ###### #####                  
            ### #######   ####                 
           ###  ########## ####                
          ####  ########### ####               
        #####   ###########  #####             
       ######   ### ########   #####           
       #####   ###   ########   ######         
      ######   ###  ###########   ######       
     ######   #### ##############  ######      
    #######  ##################### #######     
    #######  ##############################    
   #######  ###### ################# #######   
   #######  ###### ###### #########   ######   
   #######    ##  ######   ######     ######   
   #######        ######    #####     #####    
    ######        #####     #####     ####     
     #####        ####      #####     ###      
      #####      ;###        ###      #        
        ##       ####        ####

⑬girl

                                                     /*[*/#include//
                         #include//]++++[->++[->+>++++<<]<][(c)2013]
                        #ifndef                                           e//[o
                       #include//]![misaka.c,size=3808,crc=d0ec3b36][
                      #define e                                           0x1//
                     typedef struct{int d,b,o,P;char*q,*p;}f;int p,q,d,b,_=0//|
                  #include __FILE__//]>>>[->+>++<<]<[-<<+>>>++<]>>+MISAKA*IMOUTO
                #undef e//[->[-<<+<+<+>>>>]<<<<<++[->>+>>>+<<<<<]>+>+++>+++[>]]b
             #define e(c)/**/if((_!=__LINE__?(_=__LINE__):0)){c;}//[20002,+[-.+]
            ,O,i=0,Q=sizeof(f);static f*P;static FILE*t;static const char*o[]={//
          "/n/40/"8oCan/40not/40open %s/n/0aaFbfeccdeaEbgecbbcda6bcedd#e(bbed$bbd",
        "a6bgcdbbccd#ead$cdea7bccde*b$eebbdda9bsdbeccdbbecdcbbcceed#eaa&bae$cbe",
       "e&cbdd$eldbdeedbbdede)bdcdea&bbde1bedbbcc&b#ccdee&bdcdea'bbcd)e'bad(bae&bccd",
      "e&bbda1bdcdee$bbce#b$c&bdedcddca4bhcdeebbcd#e$b#ecdcc$bccda7bbcc#e#d%c*bbda",
     ">bad/bbda"};static int S(){return(o

[q]);}static/**/int/**/Z=0 ;void/**/z(int// l){if(/**/Z-l){Z=l;q++;if(p96;i=S()-(d?96:32) ;q++;if(p

,l[(q)]))++ q; t=stdin;if(q

,&P [q ] ,Q);continue ;} if(strcmp(l

,"-")){t=fopen(l [ p] ,"rb" ) ;if(!t ){{;} ; printf(05+*o,l

);return+1; {;} }}_=b= 1<<16 ; *&O=5;do{if(!(P

.q=realloc (P

.q,(P

.P += b)+1))){return 01;}O &=72 / 6/*][*/;P

.o+=d=fread(P

.q +P[ p ]. o, 1,b,t) ;}// while(d==b) ;P

.q[ P[ p] .o ]= 012;d =0; e(fclose(t ) );P

.p =P[ p] .q;if (O) {for(;d