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?

GCPのVMにVS Codeでアクセスするための設定手順メモ

Last updated at Posted at 2025-02-11

流れ

  1. ローカルで鍵生成
  2. 公開鍵をVMに登録
  3. VSCodeの設定

ローカルで鍵生成

コマンドプロンプトでssh-keygen実行
鍵の保存先確認
パスフレーズ入力(空OK)
確認

公開鍵をVMに登録

生成されたxxx.pubの内容をコピーしてSSH認証鍵に貼り付け

VSCodeのリモート接続config設定

Host <VM名>
    HostName <VMの外向き固定IP>
    User <鍵生成ローカルのユーザ名>
    IdentityFile <生成した鍵xxx>
    PasswordAuthentication no
    IdentitiesOnly yes
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?