标签: motd

如何编辑 SSH“上次登录”消息?

我想编辑Last login:与当天消息一起打印出来的信息,但我找不到生成和回显的脚本。

它在哪里定义,在易于编辑的 shell 脚本中,还是在二进制文件中关闭?


请注意,这与ServerFault不同:如何在 ssh 启动时编辑欢迎消息?. “上次登录”信息不是从内部打印出来的/etc/update-motd.d/,而是通过设置PrintLastLog标志来定义的,因此不能像当天消息的其他部分一样进行编辑。

ssh motd

18
推荐指数
2
解决办法
2万
查看次数

每个用户的 SSH MOTD

我想为 SSH 用户显示横幅(欢迎消息),并为每个用户显示一条特定的欢迎消息。

linux ssh banner motd

17
推荐指数
2
解决办法
2万
查看次数

是否可以将命令放在 /etc/motd 中?

我可以将 shell 命令放在/etc/motd登录横幅文件中吗?我试过了:

 $(uptime)
Run Code Online (Sandbox Code Playgroud)

`uptime`
Run Code Online (Sandbox Code Playgroud)

这可能吗?

linux motd

16
推荐指数
2
解决办法
6万
查看次数

如何在 Ubuntu 中配置登录消息?

每次我通过 SSH 连接到我的 AWS Ubuntu 服务器时,我都会看到一条系统信息消息,显示负载、内存使用情况和可供安装的软件包,如下所示:

Welcome to Ubuntu 12.04.3 LTS (GNU/Linux 3.2.0-51-virtual x86_64)

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

  System information as of Sun Nov 10 18:06:43 EST 2013

  System load:  0.08              Processes:           127
  Usage of /:   4.9% of 98.43GB   Users logged in:     1
  Memory usage: 69%               IP address for eth0: 10.236.136.233
  Swap usage:   100%

  Graph this data and manage this system at https://landscape.canonical.com/

13 packages can be updated.
0 updates are security updates.

Get cloud support with Ubuntu Advantage Cloud Guest …
Run Code Online (Sandbox Code Playgroud)

ubuntu login amazon-web-services motd

12
推荐指数
2
解决办法
7655
查看次数

当我使用 SSH 登录到我的服务器时,会显示两个 MOTD

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

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

sam@laptop:~$ ssh <user>@<server>
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 <ip>
Welcome to Ubuntu 12.04.2 LTS (GNU/Linux 2.6.32-042stab068.8 i686)

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

<user>@<server>:~$
Run Code Online (Sandbox Code Playgroud)

我的update-motd.d包含两个文件,00-header10-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 …
Run Code Online (Sandbox Code Playgroud)

linux ubuntu motd

8
推荐指数
1
解决办法
1万
查看次数

如何在通过 SSH 登录 RHEL8 时禁用 Web 控制台和 Red Hat Insights 提示?

每当我通过 SSH 登录 RHEL8 服务器时,都会打印以下行:

Web console: https://<myserver>:9090/ or https://<myip>:9090/

This system is not registered to Red Hat Insights. See https://cloud.redhat.com/
To register this system, run: insights-client --register
Run Code Online (Sandbox Code Playgroud)

如何禁用这些提示?

ssh redhat motd rhel8

8
推荐指数
1
解决办法
5451
查看次数

删除 Ubuntu 18.04 motd

任何人都知道要删除哪些包以 git 摆脱 Ubuntu 18.04 上的所有登录信息?

Welcome to Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-52-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

 * MicroK8s 1.15 is out! It has already been installed on more
   than 14 different distros. Guess which ones?

     https://snapcraft.io/microk8s
Run Code Online (Sandbox Code Playgroud)

我认为它可能是update-motd包,但发布后apt purge update-motd仍然有文件/目录留在/etc/. dpkg -S报告这些文件属于base-files我可能不想清除的包。

# find /etc/ | grep motd
/etc/motd
/etc/systemd/system/timers.target.wants/motd-news.timer
/etc/update-motd.d
/etc/update-motd.d/10-help-text
/etc/update-motd.d/97-overlayroot
/etc/update-motd.d/50-motd-news
/etc/update-motd.d/00-header
/etc/default/motd-news

# dpkg -S /etc/update-motd.d/10-help-text 
base-files: /etc/update-motd.d/10-help-text
Run Code Online (Sandbox Code Playgroud)

过去我只是通过强力删除文件来解决这个问题,但想知道是否有更好的方法来做到这一点。最好是我也可以轻松地ansible编写成剧本的东西。

motd ubuntu-18.04

3
推荐指数
1
解决办法
1581
查看次数

标签 统计

motd ×7

linux ×3

ssh ×3

ubuntu ×2

amazon-web-services ×1

banner ×1

login ×1

redhat ×1

rhel8 ×1

ubuntu-18.04 ×1