Code/Git

VS2019 Git SSH 연결 시 passphrase 기억

Segel 2021. 5. 16. 19:36

문제:

    VS2019 Git에서 SSH로 연결한 리포지토리의 작업을 할 때 매 작업마다 passphrase를 요구함

원인:

    VS2019에서 ssh-agent와 연결된 시스템의 ssh.exe를 사용하지 않고 자체적으로 내장되어있는 ssh.exe를 사용해 저장된 passphrase를 불러오지 못함

해결:

    64비트 윈도우 기준 해결법이다.

    developercommunity.visualstudio.com/t/visual-studio-fails-to-find-native-openssh/338518#T-N954852

 

Visual Studio Fails to find Native OpenSSH

I have GIT configured to use the native OpenSSH that comes with the latest versions of Windows 10. Using the command line interface for GIT I have no ...

developercommunity.visualstudio.com

   

cd "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\bin"
.\git.exe config --system core.sshcommand C:/Windows/SysNative/OpenSSH/ssh.exe
git config --system core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe

    이 때 visual studio 폴더에 있는 gitconfig 파일의 include를 제거하거나, 맨 위로 올려 그 아래의 설정으로 덧씌워야 한다.

    그렇지 않을 시 core.sshCommand 옵션이 System32/OpenSSH/ssh.exe로 덧씌워지게 된다.

    VS2019는 32비트 프로그램이기때문에 64비트 윈도우에서 실행 시 System32 폴더를 SysNative라는 이름으로 인식한다.

    실제로 탐색기 등에서 System32 폴더 내에 폴더를 생성한 후 Developer PowerShell 등의 32비트 쉘을 이용해 SysNative를 확인하면 System32 폴더에서 생성했던 폴더를 볼 수 있을 것이다.

반응형