跳到主要内容

创建横幅

可以创建横幅以向尝试访问集群或 SVM 的用户显示消息。在提示用户进行认证之前,控制台会话(仅限集群访问)或 SSH 会话(适用于集群或 SVM 访问)中会显示横幅。

  1. 使用 security login banner modify 命令可创建集群或 SVM 的横幅:
    如果要...则...
    指定一条单行消息使用 -message "text" 参数指定文本。
    在消息中包含换行符(也称为行尾)使用不带 -message-uri 参数的命令可启动交互模式以编辑横幅。
    从某个位置上传内容以用于横幅使用 -uri 参数指定内容的 FTP 或 HTTP 位置。

    横幅的最大大小为 2048 个字节,包括换行符。

    使用 -uri 参数创建的横幅是静态的。它不会自动刷新以反映源内容的后续更改。

    为集群创建的横幅也会对没有现有横幅的所有 SVM 显示。任何随后创建的 SVM 横幅都将覆盖该 SVM 的集群级别横幅。使用双引号内的连字符("-")为 SVM 指定 -message 参数会将 SVM 重置为使用集群级别横幅。

  2. 通过使用 security login banner show 命令显示横幅,验证横幅是否已创建。

    使用空字符串("")指定 -message 参数将显示没有内容的横幅。

    使用 "-" 指定 -message 参数将显示未配置横幅的所有(管理员或数据)SVM

创建横幅的示例

以下示例使用非交互模式创建“cluster1”集群的横幅:

cluster1::> security login banner modify -message "Authorized users only!"

cluster1::>

以下示例使用交互模式创建“svm1”SVM 的横幅:

cluster1::> security login banner modify -vserver svm1

Enter the message of the day for Vserver "svm1".
Max size: 2048. Enter a blank line to terminate input. Press Ctrl-C to abort.
0 1 2 3 4 5 6 7 8
12345678901234567890123456789012345678901234567890123456789012345678901234567890
The svm1 SVM is reserved for authorized users only!


cluster1::>

以下示例显示已创建的横幅:

cluster1::> security login banner show
Vserver: cluster1
Message
-----------------------------------------------------------------------------
Authorized users only!

Vserver: svm1
Message
-----------------------------------------------------------------------------
The svm1 <span className="ph">SVM</span> is reserved for authorized users only!

2 entries were displayed.

cluster1::>