使用 PuTTY 連接到 CLI
請確保您熟悉如何執行 PuTTY 和 plink 公用程式。
註: Windows 使用者可以從下列網站下載 PuTTY:下載 Putty。
「安全 Shell (SSH)」通訊協定規定第一次存取新的主機伺服器時要盤查 SSH 使用者,以接受 SSH 伺服器公開金鑰或使用者密碼。 因為這是第一次連接到 SSH 伺服器,伺服器尚未出現在 SSH 用戶端的已知主機清單中。因此會進行指紋盤查,詢問您是否要負責連接此主機。 如果輸入 y,SSH 用戶端會儲存主機指紋和 IP 位址。
使用 PuTTY 時,您也必須輸入 y 以接受此主機指紋。不過,主機指紋和 IP 位址會儲存在已登入 Windows 之使用者名稱的登錄中。
SSH 通訊協定也規定一旦接受 SSH 伺服器公開金鑰,如果 SSH 伺服器的指紋有所變更而不同於先前已接受的指紋,就進行另一次盤查。 在此情況下,您必須決定是否接受這個已變更的主機指紋。
註: 當叢集系統上執行微碼載入時,
IBM Spectrum Virtualize™
上的 SSH 伺服器金鑰會重新產生。結果,由於 SSH 伺服器的指紋已變更,將會提出盤查。
所有指令行介面 (CLI) 指令都在 SSH 階段作業中執行。
您可以透過下列其中一種模式來執行指令:
- 互動式提示模式
- 單行指令模式,一次輸入來包含所有參數。
互動模式
在互動模式下,您可以使用 PuTTY 執行檔來開啟 SSH 受限 Shell。
系統支援管理 IP 位址最多可以同時有 32 個互動式 SSH 階段作業。
註: 一個小時之後,固定的 SSH 互動式階段作業會逾時,表示 SSH 階段作業已自動關閉。這個階段作業逾時限制不可配置。
以下是可發出用來啟動互動模式的指令範例:
C:\support utils\putty <username>@svcconsoleip
其中,support utils\putty 是 putty.exe 檔案的位置,<username> 是管理 GUI 的 IP 位址,<username> 是您要使用的使用者名稱。
假設您發出 lsuser 指令,以列出儲存在系統上的 SSH 用戶端公開金鑰,當 ssh_key=yes 時,將會顯示下列輸出:
IBM_2145:cluster0:superuser>lsuser
id name password ssh_key remote usergrp_id usergrp_name
0 superuser yes yes no 0 SecurityAdmin
1 smith no yes no 4 Monitor
2 jones no yes no 2 CopyOperator
您可以輸入 exit 並按 Enter 鍵,以退出互動模式指令。
以下是在互動模式下使用 plink 時的主機指紋盤查範例:
C:\Program Files\IBM\svcconsole\cimom>plink superuser@9.43.225.208
The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's key fingerprint is:
ssh-rsa 1024 e4:c9:51:50:61:63:e9:cd:73:2a:60:6b:f0:be:25:bf
If you trust this host, enter "y" to add the key to
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
connection.
Store key in cache? (y/n) y
Using user name "superuser".
Authenticating with public key "imported-openssh-key"
IBM_2145:your_cluster_name:superuser>
單行指令
在單行指令模式下,您可以在一個指令行上輸入下列所有指令:
C:\Program Files\IBM\svcconsole\cimom>
plink superuser@9.43.225.208 lsuser
Authenticating with public key "imported-openssh-key"
id name password ssh_key remote usergrp_id usergrp_name
0 superuser yes yes no 0 SecurityAdmin
1 smith no yes no 4 Monitor
2 jones no yes no 2 CopyOperator
註: 如果您在單行指令模式下提交 CLI 指令及所有參數,則第一次出現 SSH 伺服器主機指紋時會盤查您。
在提交批次 Script 檔之前,務必接受 SSH 伺服器主機指紋。
以下是在單行指令模式下使用 plink 時的主機指紋盤查範例:
C:\Program Files\IBM\svcconsole\cimom>
plink superuser@9.43.225.208 lsuser
The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's key fingerprint is:
ssh-rsa 1024 e4:c9:51:50:61:63:e9:cd:73:2a:60:6b:f0:be:25:bf
If you trust this host, enter "y" to add the key to
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
connection.
Store key in cache? (y/n) y
Authenticating with public key "imported-openssh-key"
id name password ssh_key remote usergrp_id usergrp_name
0 superuser yes yes no 0 SecurityAdmin
1 smith no yes no 4 Monitor
2 jones no yes no 2 CopyOperator