2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[AIX] OpenSSH 9.9 では Host Key Algorithm +ssh-dss が無効

2
Last updated at Posted at 2026-07-05

はじめに

AIX 7.2 TL5 SP11 や AIX 7.3 TL3 SP2 以降(7.3.3.2 / 7.3.4.0 など) では OpenSSH がバージョン 9.9 に更新されます。

OpenSSH 9.9 では、長年非推奨とされてきた DSA 鍵アルゴリズム(ssh-dss)がコンパイル時に無効化されており、従来設定を残したまま更新するとSSHクライアントやsshdの起動時に設定エラーとなる場合があります。


・After upgrading to OpenSSH 9.9, sshd fails to start if ssh-dss Host Key Algorithm used

過去からAIX のバージョンアップや PTF 適用時には OpenSSH のアルゴリズムの問題でバージョンアップ後に接続できなくなるケースがよくありますので、今後のバージョンアップされる際の注意喚起を目的として、当記事を記載しています。

今回は ssh-dss を対象としていますが、バージョンアップによりご使用のアルゴリズムが使用できなくなる可能性があるということを今後もご認識に留めていただければと思います。



dsa.jpg


ssh-dss とは?

ssh-dss は SSH プロトコルにおける DSA(Digital Signature Algorithm) ベースのホスト鍵・公開鍵認証アルゴリズムです。

以下の理由から、現在では使用が推奨されていません:

  • 鍵長が 1024 ビット固定であり、現代の安全基準を満たさない
  • NIST は DSA/DSS を 2023 年で署名生成用途を廃止
  • OpenSSH は 2015 年リリースの OpenSSH 7.0 より ssh-dss をデフォルト無効化し、段階的に廃止を進めてきた

OpenSSH における廃止の経緯:

バージョン 対応内容
7.0 デフォルトで ssh-dss を無効化(設定で有効化は可能)
9.8 コンパイル時に DSA をデフォルト無効化
9.9 DSA は引き続きコンパイル時に無効。利用不可

OpenSSH 9.9 では設定ファイルで ssh-dss を指定しても認識されず、起動やコマンド実行時にエラーとなります。


環境

AIX 7.2 TL5 SP11

# oslevel -s
7200-05-11-2546

・openssh 9.9p2

# ssh -V
OpenSSH_9.9p2, OpenSSL 3.0.16 11 Feb 2025


# lslpp -l | grep openssh
  openssh.base.client  9.9.3015.2000  COMMITTED  Open Secure Shell Commands
  openssh.base.server  9.9.3015.2000  COMMITTED  Open Secure Shell Server
  openssh.man.en_US    9.9.3015.2000  COMMITTED  Open Secure Shell
  openssh.msg.Ja_JP    9.9.3015.2000  COMMITTED  Open Secure Shell Messages -
  openssh.base.client  9.9.3015.2000  COMMITTED  Open Secure Shell Commands
  openssh.base.server  9.9.3015.2000  COMMITTED  Open Secure Shell Server

確認

以下の設定が /etc/ssh/ssh_config に入っていた場合:

Host *
    HostKeyAlgorithms +ssh-rsa,ssh-dss

下記のように接続が失敗します:

# ssh root@xxx.xxx.xxx.xxx
/etc/ssh/ssh_config line 51: Bad key types '+ssh-rsa,ssh-dss'.
/etc/ssh/ssh_config: terminating, 1 bad configuration options

接続先サーバーが ssh-dss しかサポートしていないか確認する方法:

# 接続先のサーバーがどのホスト鍵アルゴリズムを提示するか確認
ssh -vvv root@xxx.xxx.xxx.xxx 2>&1 | grep "Server host key"

(参考例)

# ssh -vvv root@xxx.xx.xxx.xx 2>&1 | grep "Server host key"
debug1: Server host key: ssh-ed25519 SHA256:Zxxxxxxzuqj/qmwxxxfvrnVbbxxxxxxxxxxxxHA
  • 接続先サーバーのホスト鍵ファイルを直接確認する(AIX の場合)
ls -l /etc/ssh/ssh_host_*_key

(参考例)

# ls -l /etc/ssh/ssh_host_*_key
-rw-------    1 root     system         1361 Dec 01 2023  /etc/ssh/ssh_host_dsa_key
-rw-------    1 root     system          492 Dec 01 2023  /etc/ssh/ssh_host_ecdsa_key
-rw-------    1 root     system          387 Dec 01 2023  /etc/ssh/ssh_host_ed25519_key
-rw-------    1 root     system         2578 Dec 01 2023  /etc/ssh/ssh_host_rsa_key

DSA鍵のみをHostKeyとして公開しているサーバーは、OpenSSH 9.9 クライアントから接続できなくなります。


sshd 側の問題も確認:

/etc/ssh/sshd_configHostKey /etc/ssh/ssh_host_dsa_key が指定されている場合、OpenSSH 9.9 では sshd の起動自体が失敗します。

# sshd の設定確認
grep -i hostkey /etc/ssh/sshd_config

(参考例)

# grep -i hostkey /etc/ssh/sshd_config
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key
  • sshd の起動テスト(設定ファイルの文法チェック)
sshd -t

(参考例)

# cat /etc/ssh/sshd_config | grep ^HostKey
HostKey /etc/ssh/ssh_host_dsa_key

# stopsrc -s sshd
0513-004 The Subsystem or Group, sshd, is currently inoperative.
# startsrc -s sshd
0513-059 The sshd Subsystem has been started. Subsystem PID is 7733516.
#  sshd -t
Unable to load host key: /etc/ssh/ssh_host_dsa_key
sshd: no hostkeys available -- exiting.
#


対処方法

クライアント側(ssh_config)の対処

# 誤り:ssh-dss を含めている
Host *
    HostKeyAlgorithms +ssh-rsa,ssh-dss

# 修正:ssh-dss を除去する
Host *
    HostKeyAlgorithms +ssh-rsa

なお ssh-rsa(RSA鍵ではなくSHA-1署名アルゴリズム)は非推奨です。接続先サーバーが対応していれば、より安全な以下への移行を推奨します:

HostKeyAlgorithms +rsa-sha2-256,rsa-sha2-512
  • ただし、HostKeyAlgorithms は自動選択されるため、指定自体が不要なケースが多いです

サーバー側(sshd_config)の対処

sshd_config に DSA 鍵が設定されている場合は削除し、RSA / ECDSA / Ed25519 の鍵を使用してください:

# 新しいホスト鍵を生成(Ed25519 推奨)
ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N ""
ssh-keygen -t rsa -b 4096 -f /etc/ssh/ssh_host_rsa_key -N ""

/etc/ssh/sshd_config の HostKey 行を更新:

# HostKey /etc/ssh/ssh_host_dsa_key  ← この行を削除またはコメントアウト
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ed25519_key

影響

影響を受けるのは以下のケースです:

① クライアント側の影響(OpenSSH 9.9 環境から他サーバーへの接続)

  • ssh_config~/.ssh/configssh-dss を含む設定がある場合、ssh コマンド自体が起動時エラーで終了する
  • スクリプトや自動化ジョブで SSH を使用している場合、SSHコマンドがエラー終了し、失敗の原因となる

② サーバー側の影響(他サーバーから AIX への接続)

  • sshd_config に DSA ホスト鍵が設定されている場合、sshd の起動が失敗し、すべての SSH 接続が不可能になる

③ 接続先サーバーが DSA 鍵のみを持つ場合

  • 接続先が古いサーバー(旧 AIX、旧 Linux、ネットワーク機器等)で DSA 鍵しか持っていない場合、OpenSSH 9.9 クライアントからの接続は不可能(設定での回避手段なし)

まとめ

OpenSSH 9.9 環境では、以下の設定が使用できません:

HostKeyAlgorithms +ssh-dss
PubkeyAcceptedAlgorithms +ssh-dss

OpenSSH 9.9 環境(AIX 7.2 TL5 SP11 / AIX 7.3 TL4 以降)へのバージョンアップ前に、以下を確認・対処してください:

  1. /etc/ssh/ssh_config および ~/.ssh/config から ssh-dss の記述をすべて除去する
  2. /etc/ssh/sshd_config から HostKey /etc/ssh/ssh_host_dsa_key を除去する
  3. 接続先の古いサーバーが DSA 鍵のみの場合は、接続先側のホスト鍵を RSA / ECDSA / Ed25519 に更新する
  4. ssh-rsa も非推奨のため、可能であれば rsa-sha2-256 / rsa-sha2-512 への移行を計画する

OpenSSH Release Note の確認

OpenSSH Release Notes

OpenSSH 9.8:

DSA signature algorithm is now disabled at compile time

OpenSSH 9.9:

Currently DSA is disabled at compile time.
The final step of removing DSA support entirely is planned for the first OpenSSH release of 2025.

ssh-rsa も非推奨です。新しい RSA アルゴリズムへの移行が推奨されています。

  • rsa-sha2-256
  • rsa-sha2-512

参考文書

2
0
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?