GNU/Linux >> Linux の 問題 >  >> Linux

OpenSSHのSshクライアントはIdentityfile設定の順序を尊重していませんか?

OpenSSHのSSHクライアント(OpenSSH_7.5p1、OpenSSL1.0.2k2017年1月26日;Gitfor Windows v2.11.1)がApache Mina SSHD(Gerritコードレビューサービス)。私の意図は、RSAにフォールバックする前に、Ed25519の公開鍵と秘密鍵のペアで認証を試みることです。

ユーザーのホームディレクトリの下にある次の標準のEd25519およびRSA公開鍵と秘密鍵のペアを前提としています。

  • ~/.ssh/id_ed25519{,.pub}
  • ~/.ssh/id_rsa{,.pub}

およびユーザーのSSH構成ファイル(〜/ .ssh / config)の次のホストセクション:

Host foobar foobar.example.com
  Hostname foobar.example.com
  IdentityFile ~/.ssh/id_ed25519

Host *
  IdentityFile ~/.ssh/id_ed25519
  IdentityFile ~/.ssh/id_rsa

デバッグモードでSSH接続をテストする場合:

$ ssh -Tv [email protected]
debug1: Reading configuration data ~/.ssh/config
debug1: ~/.ssh/config line 49: Applying options for foobar
debug1: ~/.ssh/config line 63: Applying options for *
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: ~/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Offering ED25519 public key: ~/.ssh/id_ed25519
debug1: Server accepts key: pkalg ssh-ed25519 blen 51
debug1: Authentication succeeded (publickey).

OpenSSHのSSHクライアントが最初にRSA公開鍵と秘密鍵のペアを提供していることがわかります。しかし、なぜ最初のEd25519ではないのですか?

承認された回答:

IdentitiesOnlyを追加します オプション。このオプションがない場合、SSHは最初に使用可能なデフォルトのsshキーを試行します:id_rsaid_dsaid_ecdsa 。この動作を変更するには、構成を次の構成に置き換えます。

Host foobar foobar.example.com
  Hostname foobar.example.com
  IdentityFile ~/.ssh/id_ed25519
  IdentitiesOnly yes

Host *
  IdentityFile ~/.ssh/id_ed25519
  IdentityFile ~/.ssh/id_rsa
  IdentitiesOnly yes

Linux
  1. Ssh Inside Sshは「stdin:Is Not A Tty」で失敗しますか?

  2. クライアントのSsh秘密公開鍵マップ?

  3. Sshは公開鍵を受け入れませんか?

  1. TCP ラッパーによって拒否された SSH 接続

  2. SSH セッションでクライアントの IP アドレスを見つける

  3. ソックスではなく、ssh 経由の http プロキシ

  1. 別のSSHポートを使用したGitリモート追加(22ではない)

  2. ssh クライアントの「サーバーによってローミングが許可されていません」とはどういう意味ですか?

  3. Linux の日付コマンドが機能しない