我使用 WSL 在 Windows 11 上安装了 Ubuntu 22.04。然后,我使用 WSL 命令 ( --export/ --import) 将其移动到另一个磁盘上。
移动它后,默认用户是 root,所以我在 中添加了以下几行/etc/wsl.conf:
[user]
default=numa
Run Code Online (Sandbox Code Playgroud)
现在,在我启动 Ubuntu 时每天显示一次的消息中(我认为是 MOTD),我可以看到以下消息:
[/etc/update-motd.d/50-landscape-sysinfo: 17: cannot create /var/lib/landscape/landscape-sysinfo.cache: Permission denied]
Run Code Online (Sandbox Code Playgroud)
虽然看起来没什么坏处,但我想知道如何才能避免这种情况。
每隔一段时间,我就会通过 SSH 进入一个带有无人值守升级的盒子,并收到“** 系统重启需要 ***”而没有其他信息。
我的“/var/run/reboot-required.pkgs”文件包含:
linux-image-3.13.0-61-generic
linux-base
linux-base
linux-base
Run Code Online (Sandbox Code Playgroud)
我不介意重新启动,但我不喜欢在没有详细说明为什么我应该首先重新启动的情况下重新启动。在上面,我看到两个包触发了消息,但除此之外没有任何解释。
有没有办法获得有关重新启动原因的其他详细信息也显示在 SSH 登录中?
理想情况下,我想拉入一个包含人类可读内容的文件,例如“包 xyz 已在 [日期/时间] 更新。它需要修改文件 a、b 和 c,但无法修改,因为系统阻塞/将阻止该操作。下次重新启动时,文件 a、b 和 c 将被替换。” 但是一些不完全人类可读的东西也可能没问题。
当我 ssh 进入我的机器时,我想禁止生成以下消息
Expanded Security Maintenance for Applications is not enabled.
Enable ESM Apps to receive additional future security updates.
See https://ubuntu.com/esm or run: sudo pro status
Run Code Online (Sandbox Code Playgroud)
由于某种原因(我不想推测原因),这些消息不是通过正常的 motd 进程发出的,而是似乎从update-notifier. motd 目录中有一些脚本似乎可以生成这些消息,但删除它们没有效果。
如何防止我的系统在登录时生成这些消息?
我看到还有一些其他线程提到了这个错误,但我尝试了这些解决方案但没有运气。
当我登录到我的 12.04 服务器时,我收到以下消息:
/dev/sdb1 will be checked for errors at next reboot
/dev/sdc1 will be checked for errors at next reboot
Run Code Online (Sandbox Code Playgroud)
问题是检查从未完成,我继续收到消息。我在两个驱动器上都运行了 fsck,它们都很好。
我尝试禁用 /var/run 中的 motd.dynamic 重命名文件,但没有奏效,因为系统重新创建了文件。
有谁知道禁用它吗?
我最近重新安装了 Ubuntu 14.04。当我使用 SSH 时,没有 MOTD(是的,我在 sshd_config 中设置了适当的命令)。
我读了一堆关于设置 MOTD 的教程,但我意识到虽然我有 /etc/update-motd.d,但没有 /etc/motd 文件,也没有 /var/run/motd 文件。
如何设置这些以便我可以通过 SSH 获得 MOTD?
我的问题是我的文件丢失了!我在哪里可以找到它?我可以将其作为软件包的一部分重新安装(恢复)吗?哪一个?
我收到以下消息:
/etc/update-motd.d/90-updates available exited with return code 127.
Run Code Online (Sandbox Code Playgroud)
因为:
/etc/update-motd.d/90-updates: 7: /usr/share/update-notifier/notify-updates-outdates:not found
Run Code Online (Sandbox Code Playgroud)
非常感谢您的帮助!
PS:抱歉我的英语...这不是我的母语(它是西班牙语)。
通过 SSH 登录时,所有非 root用户都会显示以下文本:
Ubuntu 系统中包含的程序是免费软件;
每个程序的确切分发条款
在 /usr/share/doc/*/copyright中的各个文件中进行了描述。在
适用法律允许的范围内,Ubuntu 绝对不提供任何保证。
我的/etc/ssh/sshd_config包括:
PrintMotd no
PrintLastLog no
Run Code Online (Sandbox Code Playgroud)
PrintMotd no并PrintLastLog no通过PAM在重写/etc/pam.d/sshd
session optional pam_motd.so
session optional pam_lastlog.so never showfailed
Run Code Online (Sandbox Code Playgroud)
/var/run/motd符号链接到/etc/motd:
/etc/motd -> /var/run/motd
Run Code Online (Sandbox Code Playgroud)
文件夹/etc/update-motd.d/是空的!
如何禁止非root用户显示上述通知?
当 ssh 进入我的机器时,我看到以下内容:
Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.6-sound-29 x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
* Security certifications for Ubuntu!
We now have FIPS, STIG, CC and a CIS Benchmark.
- http://bit.ly/Security_Certification
* Want to make a highly secure kiosk, smart display or touchscreen?
Here's a step-by-step tutorial for a rainy weekend, or a startup.
- https://bit.ly/secure-kiosk
* Canonical Livepatch is available for installation.
- Reduce system reboots and improve kernel security. Activate at:
https://ubuntu.com/livepatch …Run Code Online (Sandbox Code Playgroud) 我的一台旧笔记本电脑上装有 Ubuntu 12.04 LTS。每次我通过 TTY 或 SSH 登录时,它都会说:
Welcome to Ubuntu 12.04.5 LTS (GNU/Linux 3.4.0-030400-generic i686)
* Documentation: https://help.ubuntu.com/
New release '14.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
Run Code Online (Sandbox Code Playgroud)
但是这个系统不能升级,因为这台机器太老了,不支持PAE,我也不想升级。你能告诉我如何在终端登录时隐藏这个通知(最后两行)吗?它似乎与我使用的外壳无关。
我发现了很多关于禁用 GUI 更新管理器弹出窗口的问题,但没有发现任何对终端通知有帮助的问题。
motd ×10
ssh ×4
12.04 ×1
20.04 ×1
22.04 ×1
apt ×1
banner ×1
command-line ×1
esm ×1
fsck ×1
hard-drive ×1
login ×1
notification ×1
permissions ×1
sshd ×1
upgrade ×1