はじめに
本ドキュメントでは、Nexus シリーズの ssh で使用されている Ciphers, MACs, Kex Algorithms, HostKeyAlgorithms の確認方法について紹介します。
方法1 - ssh クライアントから使用可能なアルゴリズムを確認する
Nexus に接続可能な ssh host から、`ssh -vvv <hostname>` コマンドを使用し、Nexus が使用可能なアルゴリズムを確認します。
C:\Users\xxxxx>ssh -vvv <hostname>
--------- snipped ------------
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,curve25519-sha256@libssh.org <--- Kex algorithms
debug2: host key algorithms: ssh-rsa <--- host key algorithms
debug2: ciphers ctos: aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,aes192-cbc,aes256-cbc
debug2: ciphers stoc: aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,aes192-cbc,aes256-cbc <--- encryption algorithms
debug2: MACs ctos: hmac-sha1
debug2: MACs stoc: hmac-sha1 <--- mac algorithms
尚、ssh サーバ キーを生成していない host key algorithms はこの方法だと表示されません。
ssh サーバ キーの生成については、以下ドキュメントをご参照ください。
Cisco Nexus 9000 Series NX-OS Security Configuration Guide, Release 10.5(x) - Generating SSH Server Keys
方法2 - Feature Bash-Shell を用いて dcos_sshd_config ファイルを確認する
この方法は、以下の Nexus シリーズで確認可能です。
- N3K: バージョン 7.X, 9.X, 10.X
- N9K: 全てのバージョン
- N7K: バージョン 8.2 以降
手順1. bash-shell を有効にし、bash モードに入る
switch(config)# feature bash-shell
switch(config)#
switch(config)# run bash
bash-4.3$
手順2. docs_sshd_config ファイルを確認する
bash-4.3$ cat /isan/etc/dcos_sshd_config
(抜粋)
Ciphers aes128-ctr,aes256-ctr,aes256-gcm@openssh.com,aes128-gcm@openssh.com,chacha20-poly1305@openssh.com,aes192-ctr
KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group16-sha512,diffie-hellman-group14-sha1,diffie-hellman-group14-sha256
HostKeyAlgorithms ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,rsa-sha2-256,ssh-rsa
MACs hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
方法3 - show コマンドで確認する (10.4(2), 10.5 以降)
バージョン10.4(2)、10.5(1) 以降では、show コマンドで使用可能なアルゴリズムを確認することも可能です。
switch# show ssh ?
ciphers Ciphers to encrypt the connection
kexalgos Key exchange methods that are used to generate per-connection keys
keytypes Public key algorithms that the server can use to authenticate itself to the client
macs Message authentication codes used to detect traffic modification
ciphers の例)
switch# show ssh ciphers
+-------------------------------+-----------+------+----------------+
| Cipher | Status | FIPS | CommonCriteria |
+-------------------------------+-----------+------+----------------+
| aes128-ctr | permitted | yes | yes |
| aes192-ctr | permitted | yes | yes |
| aes256-ctr | permitted | yes | yes |
| aes128-cbc | denied | no | no |
| aes192-cbc | denied | no | no |
| aes256-cbc | denied | no | no |
| aes256-gcm@openssh.com | permitted | yes | yes |
| aes128-gcm@openssh.com | permitted | yes | yes |
| chacha20-poly1305@openssh.com | permitted | no | no |
+-------------------------------+-----------+------+----------------+
参考情報