LoginSignup
2
0

More than 1 year has passed since last update.

AWS EC2内のアプリをVSCode のremote ssh接続するまで

Posted at

初めての投稿です!!
AWS: EC2
rails 6.0
VSCode

趣味でrailsアプリを開発しています。
Dockerを導入し、AWSへのデプロイを目指していますが、EC2内に置いたアプリケーション(local1ではない)をVSCodeで触れないかと考え備忘録として残します。

1 拡張機能の導入
645ea5bf97cb4b202c7defa28740c64f.png
 Remote-sshという拡張機能を有効にします。

2 configの編集
1487bf5303579f09f99754e539836bd7.png
左下のこのマークをクリックし、5f32ea739e3bf5859726825961feee46.png

Remote-SSH: Open SSH Configration Fileを選択し、一番上に表示される/Users/登録名/.ssh/configを選択します。

config
Host remotessh
    HostName <IPアドレス>
    User ec2-user
    Port 22
    IdentityFile ~/Desktop/○○.pem(pemファイルがあるパスを指定します。) 

その後また左下のマークをクリックし
1487bf5303579f09f99754e539836bd7.png
2f5e4979a66ad96e9a1548e64ab7e950.png
Remote-SSH: Connect to Hostを選び、remotesshを選択。
9e6b760cef6f73232c83b06989b4accd.png
フォルダを開く画面から自分のEC2からアプリへのパスを入力します。
f1699de9dbc9858ee8c2f137bebbdb46.png

するとできました!!7d2ce3235a6ba68f022873520ee58c22.png

2
0
2

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
2
0