How to store SSH host key in IntelliJ IDEA

后端 未结 8 859
慢半拍i
慢半拍i 2020-12-14 15:03

When using SSH as the connection for IDEA\'s git integration, IDEA keeps asking to store the host\'s rsa signature in the host key database. Pressing Yes works, but does not

相关标签:
8条回答
  • 2020-12-14 15:31

    Easy solution,
    In the IDE
    Tools-->Deployment-->options Scroll down, SFTP Advanced Options (IDE level settings)

    Change add new host key to known_known hosts to always

    0 讨论(0)
  • 2020-12-14 15:32

    I just had the same problem with IDEA 13 on Win7, and it was solved by switching to "Native" SSH executable in the Git Settings page. I did that while running Intellij as administrator as suggested by the accepted answer, but the accepted answer didn't fix the problem until I changed the SSH executable.

    0 讨论(0)
  • 2020-12-14 15:32

    It seems Windows does not let IDEA change your personal settings as easily as one would expect. Making sure the host signature can be saved fixes the issue. To let IDEA do this, run IDEA as Administrator on Vista/Win7 or unset the "Protect my computer from unauthorized program activity" in XP's Run As dialog just once. After making an SSH connection and saving the signature this fixes the annoying dialog. After saving the signature, IDEA accepts the host even when run as a mortal user.

    0 讨论(0)
  • 2020-12-14 15:38

    I also have mSysGit and I have put "C:\Program Files (x86)\Git\bin" on the PATH.

    There are at least two problems when using IntelliJ together with mSysGit and the ssh protocol with private/public keys :

    IntelliJ does not know how to bring up the message about "The authenticity of host ... can't be established" so yes it helps to run the git command once by hand to get the .ssh/known_hosts file updated.

    mSysGit when it is started directly outside of the "Git Bash" does not "know" where your home directory is and uses as .ssh folder "C:\Program Files\Git\.ssh".

    I am wondering whether setting a HOME environment variable pointing to one's Windows home directory would help. Adding to the confusion, different tools have a different notion of where your home directory lives.

    • Cygwin thinks my home directory is under C:\Users\myself\AppData\Roaming.
    • Java apps think my home directory is under C:\Users\myself
    • my network home drive is H:\ on the corporate network and some tools think my real home is H:\
    0 讨论(0)
  • 2020-12-14 15:40

    I had same issue with IDEA 13 and 14. By default, IDEA will try to create/access .ssh/known_hosts file in %HOME% directory.

    However, %HOME% was not defined on my system (Windows 7 Enterprise x64). IDEA wouldn't store key; rather, it would ask for it for every operation.

    When I defined %HOME% (%HOME% = %HOMEDRIVE% in my case), everything worked as advertised.

    This is a confirmed bug in IDEA; it should search:

    • %HOME%
    • %HOMEDRIVE%
    • %HOMEPATH%
    • %USERPROFILE%

    Check also this issue.

    0 讨论(0)
  • 2020-12-14 15:45

    Open Terminal and run below given command SSH key issue will be resolved.

    git config --global http.sslVerify false
    
    0 讨论(0)
提交回复
热议问题