码迷,mamicode.com
首页 > 系统相关 > 详细

ubuntu 登陆信息打印 -- motd

时间:2018-03-03 17:04:00      阅读:294      评论:0      收藏:0      [点我收藏+]

标签:file   from   welcome   usr   log   gpo   了解   tps   floor   

根据搜索到的资料,找到了这里:

luo[~]ssh luo@192.168.100.233
Press ^@ (C-Space) to enter file transfer mode, then ? for help

luo@192.168.100.233s 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)\n" "$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 的范畴就对了。

ubuntu 登陆信息打印 -- motd

标签:file   from   welcome   usr   log   gpo   了解   tps   floor   

原文地址:https://www.cnblogs.com/pied/p/8496651.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!