Skip to content

Instantly share code, notes, and snippets.

@charlie-x
Created January 2, 2021 19:11
Show Gist options
  • Save charlie-x/ad4b891092d872e71163b7142364a0bb to your computer and use it in GitHub Desktop.
Save charlie-x/ad4b891092d872e71163b7142364a0bb to your computer and use it in GitHub Desktop.
wsl2 ssh setup
#windows10 admin powershell
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=22 connectaddress=YOUR_WSL2IP connectport=22
netsh advfirewall firewall add rule name="Open Port 22 for WSL2" dir=in action=allow protocol=TCP localport=22
netsh interface portproxy show v4tov4
#wsl2
#first time
sudo apt-get install -y openssh-server
sudo ssh-keygen -A
sudo service ssh start
#add ssh key to wsl2 user or change sshd auth method allowed (key is better)
sudo vi /etc/ssh/sshd_config
PasswordAuthentication no
to
PasswordAuthentication yes
#vc add
sudo apt-get install -y ninja-build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment