0
2

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 1 year has passed since last update.

ssh/configの書き方

Last updated at Posted at 2023-05-13

ssh/config の書き方メモ。

C:\Users\user\.ssh\config

Host [SVName] # ここは自分の覚えやすい様に設定する
    HostName        [踏み台サーバーアドレス]
    port            [踏み台サーバーのsshdポート番号(任意)]
    IdentityFile    "[踏み台サーバーの秘密鍵パス]"
    User            [踏み台ユーザー名]

Host server.host # ここも自分の覚えやすい様に設定する
    HostName        [最終目的サーバーのアドレス]
    port            [最終目的サーバーのsshdポート番号(任意)]
    IdentityFile    "[最終目的サーバーの秘密鍵パス]"
    User            [最終目的サーバーのユーザー名]
    ProxyJump       [SVName]  #自分で設定した踏み台サーバーのHost名

example.

C:\Users\user\.ssh\config

Host proxysv
    HostName        192.168.0.1
    port            22
    IdentityFile    "C:\Users\user\.ssh\id_ed25519"
    User            root

Host server.host # ここも自分の覚えやすい様に設定する
    HostName        192.168.0.2
    port            22
    IdentityFile    "C:\Users\user\.ssh\id_ed25519"
    User            root
    ProxyJump       proxysv
0
2
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
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?