字體:  

如何調整 CentOS 7 ssh 登入後 show message

bruceman 發表於: 2017-8-21 16:49 來源: ADJ網路控股集團


有時後如果想在ssh 登入主機後.呈現自定義的 Message 訊息..你可以這樣做

首先,建立一個 script, make it executable, and save it in /etc/profile.d. Here is an example script named mot.sh:

QUOTE:

#!/bin/bash
#
echo -e "
##################################
#
# Welcome to `hostname`
# This system is running `cat /etc/redhat-release`
# kernel is `uname -r`
#
# You are logged in as `whoami`
#
##################################
"
Next, edit /etc/ssh/sshd_config as follows:

PrintMotd no

This will disable motd. Now restart the sshd service.
# service sshd restart

這樣就可以囉...