修改linux shell登陆欢迎信息

来源:互联网 发布:淘宝实拍保护怎么授权 编辑:程序博客网 时间:2024/05/22 05:30

Ubuntu欢迎信息保存在/etc/update-motd.d/,修改其中的文件即可修改欢迎信息

~# ls /etc/update-motd.d/00-header  10-help-text  90-updates-available  91-release-upgrade  98-fsck-at-reboot  98-reboot-required

修改相应文件后,执行

~# run-parts /etc/update-motd.d/

生效

默认欢迎信息:

Welcome to Ubuntu 14.04 LTS (GNU/Linux 3.13.0-24-generic x86_64) * Documentation:  https://help.ubuntu.com/260 packages can be updated.130 updates are security updates.You have new mail.Last login: Wed Jun 17 22:21:45 2015 from service

例如修改00-header:

[ -r /etc/lsb-release ] && . /etc/lsb-releaseif [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ]; then        # Fall back to using the very slow lsb_release utility        DISTRIB_DESCRIPTION=$(lsb_release -s -d)fiprintf "Welcome to %s (%s %s %s)\n" "My OS" "$(uname -o)" "$(uname -r)" "$(uname -m)"cat /etc/kylin

然后新建文件/etc/kylin:

                  ,.            -|` .*)          -!:?);?:      -,):???????"    -"????????????,   ,????????????:!`                  -|| `*????????????"-                 `(*:;;,;???????????????"(.`           `(?????"`(??????????????????;:*(,.` -')*"*())(,`  (????????????????????????;??,-   *??????????????????????????   .?????;;???;")!.` .*???????(    !???(` `-`      .)??"!*????*   `!??'         .(:?;,`  !??:).  .???`         .?!!.`  .???>

然后执行:run-parts /etc/update-motd.d/,效果:

Welcome to My OS (GNU/Linux 3.13.0-24-generic x86_64)                  ,.            -|` .*)          -!:?);?:      -,):???????"    -"????????????,   ,????????????:!`                  -|| `*????????????"-                 `(*:;;,;???????????????"(.`           `(?????"`(??????????????????;:*(,.` -')*"*())(,`  (????????????????????????;??,-   *??????????????????????????   .?????;;???;")!.` .*???????(    !???(` `-`      .)??"!*????*   `!??'         .(:?;,`  !??:).  .???`         .?!!.`  .???> * Documentation:  https://help.ubuntu.com/You have new mail.Last login: Wed Jun 17 22:24:35 2015 from 192.168.7.2

    0 0
    原创粉丝点击