集群管理 > 系统管理 > 管理横幅和 MOTD
  • 0 个评级

创建 MOTD

您可以创建每日消息 (MOTD),以便向通过身份验证的命令行界面用户传达信息。在用户通过身份验证后,显示 clustershell 提示符之前,控制台会话(仅适用于集群访问)或 SSH 会话(适用于集群或 SVM 访问)会显示此 MOTD。

步骤

  1. 使用 security login motd modify 命令为集群或 SVM 创建 MOTD:
    目的 操作
    指定单行消息 使用 -message "text" 参数指定文本。
    加入换行符(也称为行尾) 使用不带 -message-uri 参数的命令启动交互模式以编辑 MOTD。
    从某个位置上传要用于 MOTD 的内容 使用 -uri 参数指定此内容的 FTP 或 HTTP 位置。
    MOTD 最长不超过 2,048 字节(包括换行符)。

    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 来验证是否已创建此 MOTD。
    指定带空字符串 ("") 的 -message 参数可显示未配置或无内容的 MOTD。

创建 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 SVM.  Your user ID is '\N'. Your last successful login was \L.

2 entries were displayed.

cluster1::>