zoukankan      html  css  js  c++  java
  • ubuntu 登陆信息打印 -- motd

    新需求需要改变 Ubuntu 启动时的登录信息打印,根据搜索到的资料,找到了这里:

    luo[~]ssh luo@192.168.100.233
    Press ^@ (C-Space) to enter file transfer mode, then ? for help
    
    luo@192.168.100.233's password: 
    Welcome to Linux Mint 18.3 Sylvia (GNU/Linux 4.13.0-36-generic x86_64)
    
     * Documentation:  https://www.linuxmint.com
    Last login: Sat Mar  3 14:09:53 2018 from 192.168.100.233
    luo[~]tail /etc/update-motd.d/00-header 
    #    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
    
    [ -r /etc/lsb-release ] && . /etc/lsb-release
    
    if [ -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)
    fi
    
    printf "Welcome to %s (%s %s %s)
    " "$DISTRIB_DESCRIPTION" "$(uname -o)" "$(uname -r)" "$(uname -m)"
    luo[~]cat /etc/lsb-release 
    DISTRIB_ID=LinuxMint
    DISTRIB_RELEASE=18.3
    DISTRIB_CODENAME=sylvia
    DISTRIB_DESCRIPTION="Linux Mint 18.3 Sylvia"

    随后,又对 motd 进行了进一步了解。发现,ubuntu 下执行 motd 的其实是一个叫 updatemotd 的框架,也就是实际打印上面内容的地方。

    比如:https://wiki.ubuntu.com/UpdateMotd

    版本不一样,动作也有区别,但是,基本就是 motd 的范畴就对了。

  • 相关阅读:
    【leetcode】38. Count and Say
    【leetcode】132. Palindrome Partitioning II
    New Concept English three (56)
    New Concept English three (55)
    New Concept English three (54)
    listening 1
    New Concept English three (53)
    BEC translation exercise 4
    New Concept English three (52)
    MBA 工商管理课程-风险型决策方法
  • 原文地址:https://www.cnblogs.com/pied/p/8496651.html
Copyright © 2011-2022 走看看