一、在线ASCII艺术字生成
【点击直达】

█████ █████ █████ █████ ██████████ █████ █████
░░███ ░░███ ░░███ ░░███ ░░███░░░░███ ░░███ ░░███
░░███ ███ ░░███ ███ ░███ ░░███ ░░███ ███
░░█████ ░░█████ ░███ ░███ ░░█████
░░███ ░░███ ░███ ░███ ░░███
░███ ░███ ░███ ███ ░███
█████ █████ ██████████ █████
░░░░░ ░░░░░ ░░░░░░░░░░ ░░░░░
██╗ ██╗██╗ ██╗██████╗ ██╗ ██╗
╚██╗ ██╔╝╚██╗ ██╔╝██╔══██╗╚██╗ ██╔╝
╚████╔╝ ╚████╔╝ ██║ ██║ ╚████╔╝
╚██╔╝ ╚██╔╝ ██║ ██║ ╚██╔╝
██║ ██║ ██████╔╝ ██║
╚═╝ ╚═╝ ╚═════╝ ╚═╝
二、创建存放回显txt
复制你的艺术字粘贴到txt中,Ctrl+O保存,Enter回车确认,Ctrl+X退出。
2.1、新建txt
touch /etc/update-motd.d/99-welcome.txt && nano /etc/update-motd.d/99-welcome.txt
2.2、赋权txt
sudo chmod 655 /etc/update-motd.d/99-welcome.txt
三、创建Shell脚本
3.1、创建sh脚本文件
cd /etc/update-motd.d && nano 100-welcome-cat.sh
3.2、贴入如下内容
#!/bin/sh
cat /etc/update-motd.d/99-welcome.txt
bash -i #cat完保持会话不退出
3.3、赋权sh执行权限
sudo chmod +x 100-welcome-cat.sh
四、修改sshd_config
4.1、编辑sshd_config
nano /etc/ssh/sshd_config
在最下面添加如下代码
PrintMotd yes #允许打印回显
PrintLastLog yes #允许打印日志
Match User root #登录用户名
ForceCommand /etc/update-motd.d/100-welcome-cat.sh #sh脚本位置

4.2、重新加载SSH配置
sudo systemctl reload sshd
4.3、重启SSH服务
sudo systemctl restart sshd
五、验证
