0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ssh_config に設定したルールをコマンドライン起動にも適用したい

0
Posted at

おぉ、できるんだと思ったのでメモ。

こんな感じでワイルドカードの Host 指定してる際に、

~/.ssh/config
Host bastion
    HostName xxx.xxx.xxx.xxx
    User ec2-user
    IdentityFile ~/.ssh/bastion.pem

Host internal-*
    User ec2-user
    IdentityFile ~/.ssh/internal.pem
    ProxyJump bastion

Host internal-a
    HostName aaa.aaa.aaa.aaa

Host internal-b
    HostName bbb.bbb.bbb.bbb

コマンドラインから ssh 叩くときにも internal-* のルールに引っかかってほしいとき、

こんな感じで指定するといけるらしい。

$ ssh -o Hostname=ccc.ccc.ccc.ccc internal-c
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?