LoginSignup
53
46

More than 5 years have passed since last update.

GitでSSH接続のHost Key Verificationを無視する

Last updated at Posted at 2013-09-13

SSH接続の際に、対象ノード(今回はgithub)に一度も接続したことがなければ、ホスト鍵確認のため、下記のような確認プロンプトが表示される。

Initialized empty Git repository in /var/git/example.org/.git/
The authenticity of host 'github.com (12.12123.123)' can't be established.
RSA key fingerprint is 99:99:99:99:99:99:99:99:99:99:99:99:99:99:99:99.
Are you sure you want to continue connecting (yes/no)?

環境構築の自動化などをしていると、これを無視する必要がある。

下記コマンドで、github.comへの接続は、厳密なホスト鍵確認をオフにすることができる。これで、(yes/no)は聞かれない。

echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config

ssh/configを使わないで無視するには

-o オプションを使用します。

ssh -o "StrictHostKeyChecking=no"
53
46
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
53
46