Я использую OpenS SH на Windows, используя встроенный OpenS SH, включенный в обновление Осени / Осени Создателей .
Я использую s sh просто отлично в моем PowerShell, но Visual Studio Remote Development (и я предполагаю Git для Windows?) Не использует мой OpenS SH. Вместо этого они, похоже, используют Git для Windows S SH клиента от MinGW. Это означает, что все мои ssh-add
ed ключи отсутствуют в VS или Git ssh-agent
.
Как я могу заставить Visual Studio (и, возможно, Git?) Использовать встроенную OpenS SH установить, чтобы я мог использовать один и тот же ssh-agent
между ними?
PowerShell
Вот как S SH выглядит в PowerShell:
c:\Users\myusername
> Get-Command ssh
CommandType Name Version Source
----------- ---- ------- ------
Application ssh.exe 7.7.2.1 C:\WINDOWS\System32\OpenSSH\ssh.exe
c:\Users\myusername
> Get-Command ssh-agent
CommandType Name Version Source
----------- ---- ------- ------
Application ssh-agent.exe 7.7.2.1 C:\WINDOWS\System32\OpenSSH\ssh-agent.exe
C:\Users\myusername
> Get-Command ssh-add
CommandType Name Version Source
----------- ---- ------- ------
Application ssh-add.exe 7.7.2.1 C:\WINDOWS\System32\OpenSSH\ssh-add.exe
c:\Users\myusername
> ssh-add -l
2048 SHA256:HASH_HERE C:\Users\myusername\.ssh\id_rsa (RSA)
Git Bash
myusername@COMPUTERNAME MINGW64 ~
$ which ssh
/usr/bin/ssh
myusername@COMPUTERNAME MINGW64 ~
$ which ssh-agent
/usr/bin/ssh-agent
myusername@COMPUTERNAME MINGW64 ~
$ which ssh-add
/usr/bin/ssh-add
myusername@COMPUTERNAME MINGW64 ~
$ ssh-add -l
Could not open a connection to your authentication agent.
Visual Studio
Я использую VS Code Remote Development . Каждый раз, когда я вхожу на удаленный компьютер, у меня запрашивается пароль от моего личного ключа.
Без аутентификации с закрытым ключом у меня запрашивается пароль для входа (для удаленного пользователя).