SSH界面增加一个bunner
时间: 2024-03-15 21:44:21 浏览: 5
要在 SSH 界面中添加一个 banner,可以按照以下步骤操作:
1. 打开终端,以 root 用户身份登录。
2. 编辑 `/etc/issue` 文件,添加自定义的 banner 内容,例如:
```
Welcome to my system!
This system is for authorized users only. Individuals using this computer system without authority, or in excess of their authority, are subject to having all of their activities on this system monitored and recorded by system personnel.
By continuing to use this system, you indicate your awareness of and consent to these terms and conditions of use. LOG OFF IMMEDIATELY if you do not agree to the conditions stated in this warning.
```
注意,文件中的内容必须以换行符结尾。
3. 编辑 `/etc/ssh/sshd_config` 文件,将 `Banner` 选项设置为 `/etc/issue`,例如:
```
Banner /etc/issue
```
4. 重新启动 SSH 服务,使更改生效:
```
systemctl restart sshd
```
现在,每次登录到 SSH 服务器时,都会显示自定义的 banner 内容。