git.drupal.org の Git リポジトリにアクセスできない場合の対処方法

問題

2015 年 7 月以降に Drupal の公式 Git リポジトリにアクセスすると次のようなメッセージが出ることがあります。

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@       WARNING: POSSIBLE DNS SPOOFING DETECTED!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The RSA host key for git.drupal.org has changed,
and the key for the corresponding IP address 140.211.10.43
is unknown. This could either mean that
DNS SPOOFING is happening or the IP address for the host
and its host key have changed at the same time.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
(フィンガープリント).
Please contact your system administrator.
Add correct host key in (ホームディレクトリ)/.ssh/known_hosts to get rid of this message.
Offending RSA key in (ホームディレクトリ)/.ssh/known_hosts:(行番号)
RSA host key for git.drupal.org has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

接続が確立されず Git リポジトリにアクセスすることができません。

原因と対処方法

この問題の原因は、マシンに登録されている git.drupal.org の RSA キーが古くなっていることです。

既存のものを削除し新しいものに更新する必要があります。 $HOME/.ssh/known_hosts を開いて git.drupal.org に該当するエントリ(行)を削除して再度接続を試みれば OK です。 ホストを安全な接続先として登録するかどうか yes/no 聞かれるので yes と答えるとよいでしょう。

ちなみにそもそも公開鍵が登録されていないためにアクセス拒否される場合は www.drupal.org のアカウントの設定ページから公開鍵することでアクセスできるようになります。

参考


アバター
後藤隼人 ( ごとうはやと )

ソフトウェア開発やマーケティング支援などをしています。詳しくはこちら