SSH ProxyJumpアプリの無効なユーザー名

SSH ProxyJumpアプリの無効なユーザー名

次の点を考慮するとssh.cfg

Host bastion
  Hostname xx.yyy.169.100
  User ubuntu
  IdentityFile ./the-key.pem

Host 10.250.*.*
  ProxyJump %r@bastion
  User core
  IdentityFile ./the-key.pem

以下を介してサーバーに接続しようとすると、bastionsshが無効なユーザー名を適用したため失敗しました。

$ ssh -vvF ssh.cfg 10.250.198.76
...
debug1: Reading configuration data ssh.cfg
debug1: ssh.cfg line 1: Applying options for bastion
debug2: resolve_canonicalize: hostname xx.yyy.169.100 is address
debug2: ssh_connect_direct
debug1: Connecting to xx.yyy.169.100 [xx.yyy.169.100] port 22.
debug1: Connection established.
debug1: identity file ./the-key.pem type -1
debug1: identity file ./the-key.pem-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
debug1: match: OpenSSH_7.6p1 Ubuntu-4ubuntu0.3 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to xx.yyy.169.100:22 as 'core'
...

私はsshがubuntu要塞に接続したときにユーザーを適用し、ターゲットcoreサーバーに接続したときにのみユーザーを適用すると予想しました。

私が好きなように設定する方法はありますか?

ベストアンサー1

%r入力した部分は、現在SSHを介してアクセスしたいリモートシステムのProxyJumpユーザー名()を置き換えます。core必要なものは次のとおりです。

ProxyJump bastion

アイテムbastionにデフォルトのユーザー名を使用します。よりOpenSSHレシピより多くの情報を知りたいです。

おすすめ記事