29
28

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

初回SSH接続時の対話的Fingerprint確認フローをssh-keyscanでスキップする

Last updated at Posted at 2017-06-25

この記事で分かること

  • 初めてSSH接続するホストでも、fingerprint確認フローをスキップする方法

↓ こんな奴

$ ssh -T git@github.com
The authenticity of host 'github.com (192.30.255.112)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)?

やり方

$ ssh-keyscan github.com >> ~/.ssh/known_hosts

以上。

上記コマンドを実行すると、
初回SSH接続時にでる Are you sure you want to continue connecting (yes/no)? という問いに対して yes と答えたのと同じように、指定したホストの公開鍵を取得して ~/.ssh/known_hosts ファイルへ追記してくれる。

$ ssh -T git@github.com
Hi pinkumohikan! You've successfully authenticated, but GitHub does not provide shell access.

便利ですね :beers:

29
28
0

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
29
28

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?