
- Visual studio code remote ssh raspberry pi how to#
- Visual studio code remote ssh raspberry pi install#
On the Windows PC, in your PowerShell create the directory for your keys if it doesn’t exist already mkdir ~/.ssh and then change into it cd ~/.

This stage installs the SSH client on the PC, creates a keypair and copied the public key to the PI. Click on the facing arrows and select Remote-SSH: Connect to Host. If your Windows username is the same as that on the PI you can login with ssh 192.168.2.45. You should now be able to login to the Pi from the Windows PC, open Windows Terminal or PowerShell and use ssh answer yes to add it to the known hosts file and it will ask for your PI’s password. It is also useful to find the IP address of your PI with: hostname -I Mine is 192.168.2.45 and I shall being using this in the examples. Now create the directory where your keys will be kept: mkdir ~/.ssh On the Pi, in the terminal enable SSH with: sudo raspi-config then select 3 Interface Options > I2 SSH and choose Yes – Enable. SSH needs enabling on the PI and an ~/.ssh directory needs creating in your users home directory. Note that is a placeholder for your own username, the greater than symbol: > represents a Windows PowerShell prompt and the dollar sign: $ is a Linux Bash prompt.

This will start a remote debugger which will wait for a clients connection. here 1.2.3.4 is the IP of remote machine.
Visual studio code remote ssh raspberry pi install#
The PC is running Windows 11, the Raspberry Pi is running the latest version of Raspberry Pi OS – Debian Bullseye. Install this on both machine (remote & local) On your remote machine, run below command: python3 -m debugpy -listen 1.2.3.4:5678 -wait-for-client app.py. This is another one, and I aim to be fairly terse.
Visual studio code remote ssh raspberry pi how to#
There have been a lot of posts written about how to connect from Visual Studio Code (VS Code) on a Windows PC to a Raspberry PI over SSH using public/private keys avoiding the need to use a password.
