SSH Settings for Windows
Setting up SSH config in Windows
Create a config file in C:\Users\<YourUsername>\.ssh\config with the following content:
Generate SSH keys if you haven't already:
Copy the public key to the server:
powershell
cd C:\Users\<YourUsername>
type .ssh\id_rsa.pub | ssh myserver "cat >> .ssh/authorized_keys"
Forwarding SSH Port in WSL to Windows
In WSL, find IP address with:
Forward the SSH port from WSL to Windows using netsh command in PowerShell:
netsh interface portproxy add v4tov4 listenport=2222 listenaddress=0.0.0.0 connectport=22 connectaddress=<WSL IP>
Enable the port 2222 in Windows Firewall: