0
1

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 3 years have passed since last update.

Raspberry pi3 B+にVscodeからSSH remote接続

Last updated at Posted at 2022-03-30

WindowsからRaspberry pi3B+にVscode上でSSH接続するためのメモです。

接続元の端末で公開鍵と秘密鍵のペアを生成

Windowsの端末で以下コマンドで生成します。

C:\Users\ryuki>ssh-keygen -t rsa -b 2048 -f .ssh/raspberry
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in .ssh/raspberry.
Your public key has been saved in .ssh/raspberry.pub.
The key fingerprint is:
SHA256:***************************************:: ryuki@raytrek
The key's randomart image is:
+---[RSA 2048]----+
|   .oOX%o        |
|    o*&oX .      |
|    o+oB.B=o     |
|   ..+. EO=o     |
|    ..o.S.o.     |
|     o   .       |
|    o            |
|   o             |
|  .              |
+----[SHA256]-----+

C:\Users\ryuki>

~/.ssh/configに追記

Windowsの~/.ssh/configファイルに以下を追加します。

~/.ssh/config
Host raspberrypi
  HostName 192.168.11.28
  User furukawa
  Port 22
  IdentityFile ~/.ssh/raspberry

Vscodeのsettings.jsonに追記

以下を追記します。

settings.json
// SSH用に追加
"remote.SSH.configFile": "~/.ssh/config",
"remote.SSH.enableRemoteCommand": true,

vscodeから接続可能になります。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?