-
Notifications
You must be signed in to change notification settings - Fork 0
ssh into WSL
Shun Git edited this page Sep 11, 2023
·
1 revision
run the below command in Windows PowerShell to create the file with the correct permissions
New-Item -Force -ItemType Directory -Path $env:USERPROFILE\.ssh;
Add-Content -Force -Path $env:USERPROFILE\.ssh\authorized_keys -Value '[publickey]';
comment out these lines in %PROGRAMDATA%/ssh/sshd_config
(explanation)
#Match Group administrators
# AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys
Open a Windows PowerShell as admin and setup OpenSSH
Set-Service -Name sshd -StartupType 'Automatic';
Start-Service sshd;
change openssh-server
port to 2222
add to .ssh/config
Host wsl-win
HostName [host machine hostname]
User [host windows username]
Host wsl
ProxyJump wsl-win
HostName localhost
Port 2222
User [wsl username]