# 删除多余欢迎界面读取信息的文件 cd /etc/update-motd.d rm -rf 10-help-text 50-motd-news 80-esm 80-livepatch 90-updates-available 91-release-upgrade 92-unattended-upgrades 95-hwe-eol 97-overlayroot 98-fsck-at-reboot 98-reboot-required # 安装figlet(文本转换为大字母) apt-get install figlet figlet Server02 > /etc/Server02.txt # 生成欢迎界面读取的文件 cat <<EOF>> 00-header #!/bin/sh cat /etc/Server02.txt EOF # 检测是否成功run-parts mv /run/motd.dynamic /run/motd.dynamic_bak ln -s /etc/update-motd.d/ /run/motd.dynamic run-parts /etc/update-motd.d/
效果:
Connecting to 192.168.0.169:2202... Connection established. To escape to local shell, press 'Ctrl+Alt+]'. Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-99-generic x86_64) ____ ___ ____ / ___| ___ _ ____ _____ _ __ / _ \___ \ \___ \ / _ \ '__\ \ / / _ \ '__| | | |__) | ___) | __/ | \ V / __/ | | |_| / __/ |____/ \___|_| \_/ \___|_| \___/_____| System information as of Sun May 3 09:26:15 UTC 2020 System load: 0.0 Processes: 189 Usage of /: 12.5% of 48.96GB Users logged in: 0 Memory usage: 9% IP address for ens33: 10.10.10.2 Swap usage: 0% IP address for docker0: 172.17.0.1 Last login: Sun May 3 09:25:37 2020 from 192.168.0.169