跳到主要内容

SMcli https 模式

SMcli 可以在可提供更多安全功能的 https 模式下运行。

使用 CLI 时,会在以下一种模式下创建脚本引擎:

  • https – 创建具有更多安全功能的基于 REST 的脚本引擎。
  • symbol — 创建基于 SYMbol 的脚本引擎。

https 客户端中提供的安全功能:

  • 高级安全需要使用可信证书的证书认证。您可以使用

    -k 选项来使用自签名证书并在安全模式下运行命令。
  • 可以使用基于角色的访问权管理,将不同安全权限分配给不同角色。使用

    -u 选项来运行带用户名自变量的命令。
  • 以前在

    symbol 模式下提供的密码自变量也可用于 https 模式下,以便为特定用户角色指定密码。 -p 选项用于在命令行中指定密码或, -P 选项可以从文件或 stdin 中读取密码。

本主题有几个示例,有助于说明安全命令行参数:

操作需要密码,https 客户端模式,在阵列中安装可信证书

在以下示例中,提供用户名和密码选项,并且在阵列中安装可信证书。

C:\Program Files\StorageManager\client>SMcli -n Array1 -u admin@local -p
adminPassword -c "set storageArray cacheBlockSize=4;"

Syntax check complete.


Executing script...

Script execution complete.

SMcli completed
successfully.

操作需要密码,https 客户端模式,阵列中未安装任何可信证书

在以下示例中,提供用户名和密码选项,但阵列中未安装任何可信证书且未使用 -k 选项。此示例显示返回的输出。

C:\Program Files\StorageManager\client>SMcli -n Array1 -u admin@local -p
adminPassword -c "set storageArray cacheBlockSize=4;"

Unable to establish a
secure connection to the storage array as we were unable to confirm the
connection is secure.
Please configure the storage array to use a trusted
security certificate. If the problem persists, contact Technical Support.


SMcli failed.

操作需要密码,https 客户端模式,未安装可信证书,但将 -k 用作自签名证书

与以上示例相同,以下示例中提供了用户名和密码选项,但阵列中未安装任何可信证书。但是,在这种情况下使用了 -k 选项来使用自签名证书。

C:\Program Files\StorageManager\client>SMcli -n Array1 -u admin@local -p
adminPassword -c "set storageArray cacheBlockSize=4;" -k
Performing syntax
check...

Syntax check complete.

Executing script...

Script execution
complete.


操作需要密码,symbol 客户端模式

在本示例中使用 symbol 客户端模式,仅需要密码选项来成功完成此命令。

C:\Program Files\StorageManager\client>SMcli -n Array1 -p adminPassword -c "set
storageArray cacheBlockSize=4;"
Performing syntax check...

Syntax check
complete.

Executing script...

Script execution complete.

SMcli completed
successfully.

只读操作,symbol 客户端模式

在本示例中,在 symbol 客户端模式下既不提供用户名,也不提供密码。只能成功完成只读操作。

C:\Program Files\StorageManager\client>SMcli -n Array1  -c "show allVolumes;"

Performing syntax check...

Syntax check complete.

Executing script...


STANDARD/THIN VOLUMES------------------------------

Number of volumes: 0

Missing Volumes

Number of missing volumes: 0


Script execution complete.


SMcli completed successfully.

只读操作,http 客户端模式

在以下示例中还使用只读操作,但在 https 客户端模式下,需要并提供用户名和密码以及 -k 以接受自签名证书。Https 客户端模式甚至对只读操作也需要密码。

C:\Program Files\StorageManager\client>SMcli -n Array1 -u admin@local -p
adminPassword -c "show allVolumes;" -k
Performing syntax check...

Syntax
check complete.

Executing script...

THICK/THIN VOLUMES---------------------
---------

Number of volumes: 0
Missing Volumes

Number of missing
volumes: 0


Script execution complete.

SMcli completed successfully.