温馨提示×

怎样关闭debian message

小樊
43
2026-09-07 03:32:20
栏目: 智能运维

在 Debian 里你说的 “message” 通常指以下几类,不同情况关闭方式不同:


1️⃣ 关闭终端里的系统提示信息(motd / 登录信息)

如果你是指 登录后显示的欢迎信息(message of the day)

sudo chmod -x /etc/update-motd.d/*

或彻底关闭:

sudo rm /etc/motd

如果是 SSH 登录提示:

sudo nano /etc/ssh/sshd_config

改为:

PrintMotd no

然后:

sudo systemctl restart ssh

2️⃣ 关闭桌面环境的弹窗通知(Notification)

如果你是指 GNOME / KDE 等桌面弹出的 message

GNOME

gsettings set org.gnome.desktop.notifications show-banners false

完全关闭通知服务

systemctl --user stop notify-osd
systemctl --user disable notify-osd

3️⃣ 关闭内核 / 启动日志信息(dmesg)

如果你是指 启动时一堆文字

编辑 GRUB:

sudo nano /etc/default/grub

修改:

GRUB_CMDLINE_LINUX_DEFAULT="quiet"

然后:

sudo update-grub

4️⃣ 关闭命令行警告 / 邮件提示

如果是:

You have new mail.
echo "unset MAILCHECK" >> ~/.bashrc

5️⃣ 关闭 systemd 服务日志输出

sudo systemctl disable <服务名>

如果你能具体说一下:

  • 终端 / SSH / 桌面
  • 开机 / 登录 / 运行中

我可以给你更精确的命令 ✅

0