SSH/SFTP from WSL to Windows 10 with an SSH key

Поделиться
HTML-код
  • Опубликовано: 21 окт 2024
  • Keep in mind PowerShell has its own ssh and sftp client, but prefer setting these up and using them on the WSL side.
    SSH and SFTP to windows machine from WSL with an SSH key. SFTP on windows is a little funky so added a separate host in ssh config file for sftp.
    Commands used:
    Get-WindowsCapability -online | ? name -like '*ssh*'
    Add-WindowsCapability -online -name OpenSSH.Server~~~~0.0.1.0
    get-service sshd
    start-service sshd
    set-service -name sshd -startupType 'Automatic'
    type public-key.pub ([gt-sign]) authorized_keys
    ssh -t 192.168.1.2 "wsl ~"
    SSH config file equivalent of: ssh -t hostname "wsl ~"
    RequestTTY yes
    RemoteCommand "wsl ~"

Комментарии •