2

Smartgit 一直弹出登录表单!

我已经在我的服务器上部署了 git。完全按照 git 设置的说明进行操作。

然后我通过 puttygen 生成打开的 SSH 私钥,填写密码,将代码放入“公钥...授权密钥文件:”框中的记事本 ++。

之后,我复制了密钥并将其放入 authorized_keys 文件“git/.ssh/authorized_keys”并删除其中的所有结束符。

然后我通过“ssh://git@mygitserver:myport/myproject.git”克隆存储库,指向打开之前生成的SSH私钥,填写密码并登录。

我搜索了很多并尝试将所有者更改为 git 用户,更改权限,编辑密钥文件但仍然没有希望。

Smartgit 一直弹出登录表单。我该如何解决?

我无法使用 SmartGit 连接到存储库,也无法使用命令行。这是我的日志内容:`

19143347 (2013-09-07 13:24:00,907) [QThreadPoolThread-2 (smartgit.aES)] WARN  smartgit.ssh.client.ui  - could not authenticate, trying again
java.io.IOException: Publickey authentication failed.
    at com.trilead.ssh2.auth.AuthenticationManager.authenticatePublicKey(AuthenticationManager.java:314)
    at com.trilead.ssh2.Connection.authenticateWithPublicKey(Connection.java:466)
    at com.trilead.ssh2.Connection.authenticateWithPublicKey(Connection.java:519)
    at com.syntevo.dvcs.transport.ssh.f.a(SourceFile:39)
    at com.syntevo.dvcs.transport.ssh.m.a(SourceFile:150)
    at com.syntevo.dvcs.transport.ssh.h.a(SourceFile:141)
    at smartgit.aES.a(SourceFile:61)
    at smartgit.UL.run(SourceFile:24)
    at smartgit.UQ.run(SourceFile:65)
Caused by: java.io.IOException: Sorry, this connection is closed.
    at com.trilead.ssh2.transport.TransportManager.sendMessage(TransportManager.java:647)
    at com.trilead.ssh2.auth.AuthenticationManager.authenticatePublicKey(AuthenticationManager.java:282)
    ... 8 more
Caused by: java.io.IOException: Cannot read full block, EOF reached.
    at com.trilead.ssh2.crypto.cipher.CipherInputStream.getBlock(CipherInputStream.java:81)
    at com.trilead.ssh2.crypto.cipher.CipherInputStream.read(CipherInputStream.java:108)
    at com.trilead.ssh2.transport.TransportConnection.receiveMessage(TransportConnection.java:232)
    at com.trilead.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:681)
    at com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:480)
    at java.lang.Thread.run(Unknown Source)
19144230 (2013-09-07 13:24:01,790) [QThreadPoolThread-2 (smartgit.aES)] WARN  smartgit.ssh.client.ui  - could not authenticate, trying again
java.io.IOException: pubkey authentication failed
    at com.syntevo.dvcs.transport.ssh.f.a(SourceFile:40)
    at com.syntevo.dvcs.transport.ssh.m.a(SourceFile:150)
    at com.syntevo.dvcs.transport.ssh.h.a(SourceFile:141)
    at smartgit.aES.a(SourceFile:61)
    at smartgit.UL.run(SourceFile:24)
    at smartgit.UQ.run(SourceFile:65)
19144231 (2013-09-07 13:24:01,791) [Thread-163] ERROR smartgit.ssh.trilead  - com.trilead.ssh2.transport.TransportManager: Receive thread: error in receiveLoop: socket closed
19144841 (2013-09-07 13:24:02,401) [main] INFO              q.dialog  - Showing dialog 75 (@1E95534) '@1D8EDCE - SSH Authentication' (owner: @520C83)
19144859 (2013-09-07 13:24:02,419) [main] INFO  q.swt.shellActivation  - shell deactivated Shell {Clone}@520C83
19144860 (2013-09-07 13:24:02,420) [main] INFO  q.swt.shellActivation  - shell activated Shell {SSH Authentication}@1E95534
19144860 (2013-09-07 13:24:02,420) [main] INFO  q.swt.shellActivation  - Activation change from Shell {Clone}@520C83 to Shell {SSH Authentication}@1E95534
19146675 (2013-09-07 13:24:04,235) [main] INFO  q.swt.shellActivation  - shell deactivated Shell {SSH Authentication}@1E95534
19146677 (2013-09-07 13:24:04,237) [main] INFO  q.swt.shellActivation  - Activation change from Shell {SSH Authentication}@1E95534 to null
19264293 (2013-09-07 13:26:01,853) [Thread-165] ERROR smartgit.ssh.trilead  - com.trilead.ssh2.transport.TransportManager: Receive thread: error in receiveLoop: Cannot read full block, EOF reached.
23254777 (2013-09-07 14:32:32,337) [main] INFO  q.swt.shellActivation  - shell activated Shell {SSH Authentication}@1E95534
23254777 (2013-09-07 14:32:32,337) [main] INFO  q.swt.shellActivation  - Activation change from null to Shell {SSH Authentication}@1E95534
23257318 (2013-09-07 14:32:34,878) [main] INFO  q.swt.shellActivation  - shell deactivated Shell {SSH Authentication}@1E95534
23257320 (2013-09-07 14:32:34,880) [main] INFO  q.swt.shellActivation  - Activation change from Shell {SSH Authentication}@1E95534 to null
23325752 (2013-09-07 14:33:43,312) [main] INFO  q.swt.shellActivation  - shell activated Shell {SSH Authentication}@1E95534
23325752 (2013-09-07 14:33:43,312) [main] INFO  q.swt.shellActivation  - Activation change from null to Shell {SSH Authentication}@1E95534
23326238 (2013-09-07 14:33:43,798) [main] INFO  q.swt.shellActivation  - shell deactivated Shell {SSH Authentication}@1E95534
23326239 (2013-09-07 14:33:43,799) [main] INFO  q.swt.shellActivation  - Activation change from Shell {SSH Authentication}@1E95534 to null

`

4

2 回答 2

3
  • SmartGit 只能处理 OpenSSH 类型的密钥
  • Puttygen 生成 Putty 类型的密钥

必须转换(使用 Puttygen)以前创建的 Putty 的 *.ppk

PuTTY-User-Key-File-2: ssh-rsa
...

到 OpenSSH 的私钥文件

-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----

并仅与 Smart* 线路一起使用 OpenSSH 版本的密钥

于 2013-09-07T10:00:36.707 回答
0

谢谢大家!我自己解决了。我的错误是没有在 git link 中使用绝对路径。另外,我没有正确设置 git 用户的主目录,因此也导致错误权限被拒绝。

然后从 authorized_keys 上的每个 SSH 密钥中删除结束行字符。那会成功的!

于 2013-09-09T00:16:53.787 回答