简体   繁体   English

在Windows上的Rubymine中通过SSH设置git

[英]Setup git over ssh in Rubymine on Windows

I found a lot of threads about how to setup git over ssh with msysgit and putty/plink, but rubymine seems to use its own git and ssh implementation (see error message below). 我发现了很多关于如何使用msysgit和putty / plink在ssh上设置git的线程,但是rubymine似乎使用了自己的git和ssh实现(参见下面的错误消息)。

Currently I have putty, msysgit, TortoiseGit and rubymine installed. 目前我已经安装了putty,msysgit,TortoiseGit和rubymine。 My repository has two remotes: 我的存储库有两个遥控器:

[remote "origin"]
    url = ssh://mygituser@255.255.255.255:1234/path/to/repo.git
[remote "origin_putty"]
    url = putty-alias:path/to/repo.git
    puttykeyfile = path/to/my/putty/keyfile.ppk

In putty the connection "putty-alias" is defined with the same user, host and port used in origin and also sets the ssh key again (might not be necessary). 在putty中,连接“putty-alias”是使用在origin使用的相同用户,主机和端口定义的,并且还重新设置ssh密钥(可能不是必需的)。 Using TortoiseGit to push to origin_putty works fine since it loads the putty ssh key and prompts for my passphrase. 使用TortoiseGit推送到origin_putty工作正常,因为它加载putty ssh键并提示我的密码短语。 However, when I'm trying to use origin from rubymine it prompts for the password of mygituser since there is no keyfile defined. 然而,当我试图使用origin从RubyMine的它会提示输入密码mygituser因为没有定义密钥文件。

I already tried the following solutions 我已经尝试了以下解决方案

  • Setting GIT_SSH to plink, running pageant and loading the key there (no change) 将GIT_SSH设置为plink,运行选美并在那里加载密钥(无更改)
  • using the puttykeyfile line in the definition of origin (no change) origin定义中使用puttykeyfile行(无变化)
  • using origin_putty from rubymine (does not resolve putty-alias ) 使用origin_putty从RubyMine的(没有解决putty-alias

The reason I think rubymine uses its own ssh implementation is the error message I get on an unsuccessful authentication: SSH: authentication methods: [publickey, keyboard-interactive, password] last successful method: 我认为rubymine使用自己的ssh实现的原因是我在不成功的身份验证上得到的错误消息:SSH:身份验证方法:[publickey,keyboard-interactive,password]最后成功的方法:

java.io.IOException: Authentication failed: 
    at org.jetbrains.git4idea.ssh.SSHMain.authenticate(SSHMain.java:280)
    at org.jetbrains.git4idea.ssh.SSHMain.start(SSHMain.java:155)
    at org.jetbrains.git4idea.ssh.SSHMain.main(SSHMain.java:135)
fatal: The remote end hung up unexpectedly

You're right: by default RubyMine uses trilead-ssh2 Java library, and is not aware about Putty settings. 你是对的:默认情况下,RubyMine使用trilead-ssh2 Java库,并且不了解Putty设置。

You may switch to using the native SSH in the Settings | 您可以在“设置”中切换到使用本机SSH Version Control | 版本控制| Git | Git | SSH Executable | SSH可执行文件| Native But note, that it doesn't work well with passphrases, so if your private key is passphrase protected, you have to use pageant or similar software. 本机但请注意,它与密码短语不兼容,因此如果您的私钥受密码保护,则必须使用选美或类似软件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM