Linux下如何修改ssh登录欢迎信息

1.效果预览:

103425_N9ln_2276973.png

2.操作步骤:

2.1. 新建一个sh脚本文件

vim motd.sh

2.2. 在文件中添加如下内容(可根据需要自行修改echo部分的内容)

#!/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

2.3. 以root用户执行该脚本

./motd.sh 或 sh motd.sh

转载于:https://my.oschina.net/antsky/blog/347382

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值