【问题标题】:"invalid command syntax" hg clone ssh windows using .ppk key“无效的命令语法”hg 使用 .ppk 键克隆 ssh 窗口
【发布时间】:2016-09-23 11:18:47
【问题描述】:

我正在尝试使用身份验证密钥(.ppk 文件)在 Windows 平台上克隆 bitbucket 存储库。我知道与服务器的连接很好,因为我之前遇到过“服务器拒绝连接”错误,但现在我收到“无效命令语法错误”

这是我正在使用的命令(我运行带有 --debug 标签的“hg clone”命令来获取完整的命令):

running "C:\Program Files/TortoiseHg/lib/tortoiseplink.exe" -ssh -v -i "C:\Users
\user\key.ppk" -noagent hg@bitbucket.org hg@bitbucket.org "hg -R repo/path serve 
--stdio"

这是我从此命令得到的输出:

running "C:\Program Files/TortoiseHg/lib/tortoiseplink.exe" -ssh -v -i "C:\Users
\user\key.ppk" -noagent hg@bitbucket.org hg@bitbucket.org "hg -R repo/path serve 
--stdio"
sending hello command
sending between command
remote: Looking up host "bitbucket.org"
remote: Connecting to 104.xxx.xxx.1 port 22
remote: Server version: SSH-2.0-OpenSSH_5.3
remote: Using SSH protocol version 2
remote: We claim version: SSH-2.0-PuTTY_Local:_Feb__4_2012_13:00:34
remote: Doing Diffie-Hellman group exchange
remote: Doing Diffie-Hellman key exchange with hash SHA-256
remote: Host key fingerprint is:
remote: ssh-rsa 2048 97:8c:xx:xx:xx:14:6b:5c:3b:ec:aa:46:46:74:7c:40
remote: Initialised AES-256 SDCTR client->server encryption
remote: Initialised HMAC-SHA1 client->server MAC algorithm
remote: Initialised AES-256 SDCTR server->client encryption
remote: Initialised HMAC-SHA1 server->client MAC algorithm
remote: Reading private key file "C:\Users\user\key.ppk"
remote: Using username "hg".
remote: Offered public key
remote: Remote debug message: Forced command: conq username:user
remote: Remote debug message: Port forwarding disabled.
remote: Remote debug message: X11 forwarding disabled.
remote: Remote debug message: Agent forwarding disabled.
remote: Remote debug message: Pty allocation disabled.
remote: Offer of public key accepted
remote: Authenticating with public key "rsa-key-20160523"
remote: Sent public key signature
remote: Remote debug message: Forced command: conq username:user
remote: Remote debug message: Port forwarding disabled.
remote: Remote debug message: X11 forwarding disabled.
remote: Remote debug message: Agent forwarding disabled.
remote: Remote debug message: Pty allocation disabled.
remote: Access granted
remote: Opened channel for session
remote: Started a shell/command
remote: Server sent command exit status 1
remote: Disconnected: All channels closed
remote: conq: invalid command syntax.
hg : abort: no suitable response from remote hg!

如果有人可以提供一些帮助,将不胜感激。

【问题讨论】:

  • @Kenster 对此感到抱歉。我按要求添加了文本而不是屏幕截图。

标签: windows ssh mercurial clone bitbucket


【解决方案1】:

你也可以看到线条

remote: conq: invalid command syntax.
abort: no suitable response from remote hg!

如果您不小心在命令中粘贴了特殊字符。这让我想到了粘贴线

hg clone ssh://hg@bitbucket.org/your/repo .

来自维基文章。 clone 和 ssh 之间的空格和末尾的句点都导致了问题。这是一个不幸的假设/令人头疼的事情。手动输入是我对任何看到此错误的人的建议。

【讨论】:

    【解决方案2】:

    修复它。

    错误出现在我的通话中...

    “hg@bitbucket”应该只在调用中出现过一次...

    running "C:\Program Files/TortoiseHg/lib/tortoiseplink.exe" -ssh -v -i "C:\Users
    \user\key.ppk" -noagent hg@bitbucket.org "hg -R repo/path serve 
    --stdio"
    

    我在 mercurial.ini 文件中重新映射了 ssh,如下所示:

    ssh = "C:\Program Files/TortoiseHg/lib/tortoiseplink.exe" -ssh -v -i "C:\Users\user\key.ppk" -noagent hg@bitbucket.org
    

    但它应该是:

    ssh = "C:\Program Files/TortoiseHg/lib/tortoiseplink.exe" -ssh -v -i "C:\Users\user\key.ppk" -noagent
    

    希望这可以帮助其他遇到问题的人^^

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-05-28
      • 2021-09-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-02-19
      相关资源
      最近更新 更多