我在 VirtualBox 中有一个 Debian/Linux 虚拟机。
# uname -a
Linux debian 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) x86_64 GNU/Linux
# vi /etc/motd
##########################
Hi, welcome to the server!
##########################
~
~
~
~
~
"/etc/motd" 6 lines, 84 characters written
:wq!
/etc/motd
当我退出终端并以 root 身份登录时,不会出现该消息。
root@debian:~#
我怎样才能让该消息出现?
答案1
现代 Debian(以及许多其他发行版)使用了pam_motd
他们的 PAM 堆栈。看到这个Debian 维基文章更多细节。
您可能有一个自定义的 PAM 环境,或者您的 root 用户有一个 ~/.hushlogin。
答案2
ssh_config
您可以在(或sshd_config
- 这取决于操作系统)中定义横幅。通常它位于/etc/issue
,当您通过 登录时,您放入此问题文件中的所有内容都会显示出来ssh
。