Show pagesourceBack to top Share via Share via... Twitter LinkedIn Telegram Yammer RedditRecent ChangesSend via e-MailPrintPermalink × Table of Contents Shells OpenSSH Client Use OpenSSH Agent in Git for Windows Use OpenSSH Agent in WSL2 Server SSH in Microsoft® Windows™ Shells Recommended is the msys2 shell, installable through chocolatey. If you want to transfer files with a GUI, you can use WinSCP. Don't use PuTTY, it's old and slow. If you absolutely must use a GUI tool, KiTTY is the better alternative. OpenSSH Client The OpenSSH client is installed by default since 2018. For earlier versions of Windows, you can enable it in the Windows Features1. You can run the OpenSSH Agent by enabling it in the system settings and use KeePassXC2 or PuTTY Pageant to fill its keystore3. # By default the ssh-agent service is disabled. Make sure you're running as an Administrator. Get-Service ssh-agent | Set-Service -StartupType Automatic # This should return a status of Running Get-Service ssh-agent # Now load your key files into ssh-agent ssh-add ~\.ssh\id_ed25519 Use OpenSSH Agent in Git for Windows The environment variables have to be set properly.4 [Environment]::SetEnvironmentVariable("GIT_SSH", "$((Get-Command ssh).Source)", [System.EnvironmentVariableTarget]::User) Use OpenSSH Agent in WSL2 To use the OpenSSH agent provided by the Linux Subsystem on Windows (WSL), e.g. to connect with your Ubuntu or Debian shell to remote hosts, you can use npiperelay. In WSL2, you need to install socat and put the following in your .bashrc (if you use bash):5 .bashrc export SSH_AUTH_SOCK=$HOME/.ssh/agent.sock ss -a | grep -q $SSH_AUTH_SOCK if [ $? -ne 0 ]; then rm -f $SSH_AUTH_SOCK (setsid socat UNIX-LISTEN:$SSH_AUTH_SOCK,fork EXEC:"$HOME/winhome/go/bin/npiperelay.exe -ei -s //./pipe/openssh-ssh-agent",nofork &) >/dev/null 2>&1 fi This assumes you have a symlink from ~/winhome to your Windows home directory (usually in /mnt/c/Users/). Server OpenSSH server is available for Windows and you can even use PowerShell through it. # Set the sshd service to be started automatically Get-Service -Name sshd | Set-Service -StartupType Automatic # Now start the sshd service Start-Service sshd [1] https://www.bleepingcomputer.com/news/microsoft/heres-how-to-enable-the-built-in-windows-10-openssh-client/ [3] https://docs.microsoft.com/de-de/windows-server/administration/openssh/openssh_keymanagement [4] https://snowdrift.tech/cli/ssh/git/tutorials/2019/01/31/using-ssh-agent-git-windows.html [5] https://code.mendhak.com/wsl2-keepassxc-ssh/#tell-wsl-to-use-it Last modified: 2021-10-20 08:44