Linux 下如何修改 ssh 登录欢迎信息
效果预览
操作步骤
新建一个sh脚本文件
1
vim motd.sh
在文件中添加如下内容(可根据需要自行修改
echo
部分的内容)1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26!/bin/bash
define the filename to use as output
motd="/etc/motd"
Collect useful information about your system
$USER is automatically defined
HOSTNAME=`uname -n`
KERNEL=`uname -r`
CPU=`uname -p`
ARCH=`uname -m`
The different colours as variables
W="\033[01;37m"
B="\033[01;34m"
R="\033[01;31m"
X="\033[00;37m"
G="\033[01;32m"
clear > $motd # to clear the screen when showing up
echo -e " " >> $motd
echo -e " Welcome to $B Your-Host-Name $X server. " >> $motd
echo -e " " >> $motd
echo -e " $G The world is not you can do, but you should. $X " >> $motd
echo -e "$B" >> $motd
echo -e " \ ,__, " >> $motd
echo -e " \ (oo)____ " >> $motd
echo -e " (__) )\ " >> $motd
echo -e " ||--|| * " >> $motd
echo -e "$X" >> $motd以root用户执行该脚本
1
2
3$ ./motd.sh
或
$ sh motd.sh