跳到主要内容

创建 MOTD

您可以创建当天消息(MOTD)以便将信息传递给经过认证的 CLI 用户。MOTD 在用户通过认证且 clustershell 提示符出现前,在控制台会话(仅限集群访问)或 SSH 会话(适用于集群或 SVM 访问)中显示。

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

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

    security login motd modify 手册页介绍了可用于 MOTD 显示动态生成内容的转义序列。

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

    默认情况下也会为所有 SVM 登录显示为集群创建的 MOTD,同时还会显示为给定 SVM 单独创建的 SVM 级别的 MOTD。为某个 SVM-is-cluster-message-enabled 参数设置为 false 将阻止为该 SVM 显示集群级别的 MOTD。

  2. 通过使用 security login motd show 命令显示 MOTD,验证它是否已创建。

    使用空字符串("")指定 -message 参数会显示未配置或没有内容的 MOTD。

    请参阅 security login motd modify 命令手册页,了解可使用哪些参数来使 MOTD 显示动态生成的内容。请务必查看特定于 ONTAP 版本的手册页。

创建 MOTD 的示例

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

cluster1::> security login motd modify -message "Greetings!"

cluster1::>

以下示例使用交互模式来创建“svm1”SVM 的 MOTD,并使用转义序列显示动态生成的内容:

cluster1::> security login motd 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
Welcome to the \n SVM. Your user ID is '\N'. Your last successful login was \L.

cluster1::>

以下示例显示已创建的 MOTD:

cluster1::> security login motd show
Vserver: cluster1
Is the Cluster MOTD Displayed?: true
Message
-----------------------------------------------------------------------------
Greetings!

Vserver: svm1
Is the Cluster MOTD Displayed?: true
Message
-----------------------------------------------------------------------------
Welcome to the \n <span className="ph">SVM</span>. Your user ID is '\N'. Your last successful login was \L.

2 entries were displayed.

cluster1::>