修改Ubuntu远程登录欢迎提示信息

无论何时登录公司的某些生产系统,你都会看到一些登录消息、警告或关于你已登录服务器的信息,如下所示。

修改方式

1.打开ubuntu终端,进入到/etc/update-motd.d目录下面

可以发现目录中的文件都是shell脚本, 用户登录时服务器会自动加载这个目录中的文件, 所以就能看到欢迎信息了。文件名都是数字开头的, 数字越小的文件越先加载

bash 复制代码
lu@host:/etc/update-motd.d$ ls
00-header             91-release-upgrade  98-reboot-required
10-help-text          95-hwe-eol          99-esm
90-updates-available  98-fsck-at-reboot   
lu@host:/etc/update-motd.d$ 

2.新建文件99-welcome,修改当前文件权限

bash 复制代码
lu@host:/etc/update-motd.d$ sudo touch 99-welcome
lu@host:/etc/update-motd.d$ sudo chmod 777 99-welcome

3.打开99-welcome文件,修改其中内容

bash 复制代码
lu@host:/etc/update-motd.d$ sudo vim 99-welcome

4.写入你想要显示的具体内容

bash 复制代码
#!/bin/sh

echo " |ˉ|      |ˉ||ˉˉˉˉˉˉˉˉˉˉ||ˉ|         |ˉ|          /ˉˉˉˉˉˉˉˉ\             |ˉ|  /ˉˉ\  |ˉ| /ˉˉˉˉˉˉˉˉ\ |ˉˉˉˉˉˉˉˉˉ\ |ˉ|         |ˉˉˉˉˉˉˉˉ\   "
echo " | |      | || |ˉˉˉˉˉˉˉˉ | |         | |         / /ˉˉˉˉˉˉ\ \            | | / /\ \ | |/ /ˉˉˉˉˉˉ\ \| |ˉˉˉˉˉˉ\ \| |         | |ˉˉˉˉˉ\ \  "      
echo " |  ˉˉˉˉˉˉ  ||  ˉˉˉˉˉˉˉˉ|| |         | |         | |      | |            | | | || | | || |      | || |      | || |         | |      | | "      
echo " | |ˉˉˉˉˉˉ| || |ˉˉˉˉˉˉˉˉ | |         | |         | |      | |            | | | || | | || |      | || ˉˉˉˉˉˉˉ  /| |         | |      / | "      
echo " | |      | || |         | |         | |         \ \      / /             \ ˉ /  \ ˉ / \ \      / /| |ˉˉˉˉ\ \ˉ | |         | |     / /  "      
echo " | |      | ||  ˉˉˉˉˉˉˉˉ||  ˉˉˉˉˉˉˉˉ||  ˉˉˉˉˉˉˉˉ| \ ˉˉˉˉˉˉ /               \ /    \ /   \ ˉˉˉˉˉˉ / | |     \ \ |  ˉˉˉˉˉˉˉˉ||  ˉˉˉˉˉ /   "
echo "  ˉ        ˉ  ˉˉˉˉˉˉˉˉˉˉ  ˉˉˉˉˉˉˉˉˉˉ  ˉˉˉˉˉˉˉˉˉˉ   ˉˉˉˉˉˉˉˉ                 ˉ      ˉ     ˉˉˉˉˉˉˉˉ   ˉ       ˉˉ  ˉˉˉˉˉˉˉˉˉˉ  ˉˉˉˉˉˉˉˉ    "

在console或者shell中打印字符图案的小工具

https://github.com/starkwang/alphabetJS

5.至此登录后的信息显示也已完成,重启查看显示内容

相关推荐
a41324473 小时前
ubuntu 25 安装vllm
linux·服务器·ubuntu·vllm
上天_去_做颗惺星 EVE_BLUE10 小时前
Docker高效使用指南:从基础到实战模板
开发语言·ubuntu·docker·容器·mac·虚拟环境
芋圆奶绿,要半t14 小时前
ubuntu20/2204修改系统时间的命令
ubuntu
s_daqing16 小时前
arm的ubuntu启动node
linux·arm开发·ubuntu
GIS瞧葩菜18 小时前
entity几何体轴编辑(沿 Z 轴平移)完整流程拆解
linux·运维·ubuntu
bjxiaxueliang1 天前
一文解决蓝牙连接难题:Ubuntu命令行蓝牙强制配对
linux·ubuntu·蓝牙连接命令
Will_Ye1 天前
Ubuntu22.04 蓝牙设备快速自动连接
ubuntu·bluetoothctl
lihe7581 天前
每天凌晨3点自动同步UBUNTU源
linux·运维·ubuntu·本地源
zbliquan1 天前
SS928v100远程ubuntu交叉编译开发环境搭建
linux·运维·ubuntu
_叶小格_1 天前
cp、scp、rsync命令详解
linux·运维·服务器·ubuntu·centos·运维开发