▲ SSH 登录前提示信息

修改 /etc/ssh/sshd_config ,找到 # Banner ,新增一行或解开注释,内容为:

1
Banner /etc/ssh/banner

随后创建文件 /etc/ssh/banner ,自定义所需内容即可,也可参考当前目录下 banner

最后执行以下命令即可生效:

1
service sshd restart

1
systemctl restart sshd

附上自己的 banner 作为例子:

1
2
3
4
5
6
#####################################################################
# Welcome to SDokio.cn #
# #
# All connections are monitored and recorded #
# Disconnect IMMEDIATELY if you are not an authorized user! #
#####################################################################