linux的motd显示时间,linux – 当我使用SSH登录我的服务器时,显示了两个MOTD

我想更改登录到TTY上的计算机时显示的MOTD,这似乎有效,但不知何故,它不只是在/ etc / motd和/etc/update-motd.d/中显示MOTD ,还有另一条消息.

登录到我的服务器时显示:

sam@laptop:~$ssh @

Welcome to Ubuntu 12.04.2 LTS (GNU/Linux 2.6.32-042stab068.8 i686)

* Documentation: https://help.ubuntu.com/

No mail.

Last login: Thu Feb 21 19:20:55 2013 from

Welcome to Ubuntu 12.04.2 LTS (GNU/Linux 2.6.32-042stab068.8 i686)

* Documentation: https://help.ubuntu.com/

@:~$

我的update-motd.d包含两个文件,00-header和10-help-text.

00-header包含以下内容:

[ -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)"

10-help-text包含:

[ -r /etc/lsb-release ] && . /etc/lsb-release

if [ -z "$DISTRIB_RELEASE" ] && [ -x /usr/bin/lsb_release ]; then

# Fall back to using the very slow lsb_release utility

DISTRIB_RELEASE=$(lsb_release -sr)

fi

URL="https://help.ubuntu.com/"

if uname -r | grep -qs "\-server"; then

URL="https://help.ubuntu.com/$DISTRIB_RELEASE/serverguide/C"

fi

printf "\n * Documentation: %s\n" "$URL"

这将弥补MOTD的部分,直到没有邮件..但其余部分来自哪里?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值