LoginSignup
0
0

More than 1 year has passed since last update.

【備忘録】開発環境の作り方 - ホストとゲスト間のSSH接続 -

Last updated at Posted at 2021-09-17

SSH接続 (putty)

クライアント

秘密鍵と公開鍵の作成 (作成済みの場合は次の手順へ)
    公開鍵をサーバーへ転送
        > cd C:\Users\[User]\.ssh
        > scp id_rsa.pub user@192.168.11.10:id_rsa.pub
        (yes -> password)

    認証ファイル指定
        Connection → SSH → Auth
            Private key file for authentication
                C:\Users\(user)\.ssh\id_rsa.pub

    設定ファイル作成
        C:\Users\post\.ssh\config を編集
            Host bridge
                HostName 192.168.11.10
                User tonoaki_sato
                IdentityFile C:\Users\post\.ssh\id_rsa.pem
                Port 22
                TCPKeepAlive yes
                IdentitiesOnly yes

サーバー

$ cd ~/
$ ssh-keygen -i -f id_rsa.pub >> authorized_keys    // ファイル形式変換(putty -> openssh)
$ mkdir .ssh
$ chmod 700 .ssh
$ mv authorized_keys .ssh
$ chmod 600 .ssh/authorized_keys
$ rm -f id_rsa.pub

SSH接続 (VScode)

上記の設定が済んでいる事
VScode起動 → 左下の緑色の部分をクリック → 「Connect to host」→ 「bridge」をクリック
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