在 Debian 系统中,“message 提示”可能指几种不同来源的信息。下面按常见情况说明如何关闭或抑制这些提示。
Debian 登录后会显示:
/etc/motd/etc/update-motd.d/)sshd 的提示sudo rm -f /etc/motd
或清空内容:
sudo truncate -s 0 /etc/motd
sudo chmod -x /etc/update-motd.d/*
编辑:
sudo nano /etc/ssh/sshd_config
修改为:
PrintMotd no
重启 SSH:
sudo systemctl restart ssh
删除提示文件:
sudo rm -f /var/run/reboot-required
(注意:这只是隐藏提示,不代表系统不需要重启)
sudo nano /etc/apt/apt.conf.d/50unattended-upgrades
关闭:
Automatic-Reboot false
echo "unset MAILCHECK" >> ~/.bashrc
sudo apt remove command-not-found
如果你说的是开机启动时的 message 日志:
编辑:
sudo nano /etc/default/grub
修改:
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
更新:
sudo update-grub
gsettings set org.gnome.desktop.notifications show-banners false
比如:
告诉我具体场景即可。