2017-06-30 12 views
1

チェンジセットをリモートリポジトリにプッシュしようとしていますが、コマンドが手渡しているように見えて何も起こりません。SSHプロトコルによるhgプッシュ失敗の診断方法

私はWindows 8.1上で、Mercurial(4.2)の最新バージョンを実行しています。私は鍵認証かパスワードベースのどちらを使っていても問題なくPuTTYとOpenSSHクライアントを使用して私のサーバーにSSH接続することができます。

マイhgrcファイルがこれを持っている:ここでは

[ui] 
... 
ssh = ssh -i "path_to_id_file" -2 -C 

[defaults] 
... 
push = --debug 

は、私は、コマンドラインに乗る出力されます。その後

pushing to ssh://[email protected]//var/hgrepos/projectx 
running ssh -i "path_to_id_file" -2 -C [email protected] "hg -R /var/hgrepos/projectx serve --stdio" 
sending hello command 
sending between command 

、何も分、起こりません。私は私の秘密鍵にパスフレーズを与えなければならないと思っていました。単にssh [email protected]と入力したときと同じです。 Ctrl + Cは何もしません。ウィンドウを閉じる必要があります。

私はキー認証を使用しているのか、パスワード認証を使用しているのかにかかわらず、プッシュは常に「コマンド送信中」の直後に無期限にハングします。ある時点で、私は鍵のパスフレーズやパスワードが期待されていると思っていましたが、どちらかの入力は肯定的なものではありませんでした。

私はこのリモートサーバーを管理しており、HTTPSとMercurialを使用してこのリモートサーバーを長年にわたって管理しており、そのプロトコルを通じて期待どおりに動作します。私は徐々にキーベースの認証に移行しており、hgはこの道を歩む最後のステップです。

最後の情報:hg cloneは同じ動作を示します。

これを診断するのに役立つものは、非常に高く評価されます。私は、サーバー上のSSHログを有効にしていると/var/log/secure tail'ingとき、私はこれを取得

EDIT(これらの行は、私が以前に与えた4行のものをサーバー側で一致している):

Jul 4 13:15:40 vpsxxxxx sshd[11654]: debug1: Forked child 15779. 
Jul 4 13:15:40 vpsxxxxx sshd[15779]: Set /proc/self/oom_score_adj to 0 
Jul 4 13:15:40 vpsxxxxx sshd[15779]: debug1: rexec start in 5 out 5 newsock 5 pipe 7 sock 8 
Jul 4 13:15:40 vpsxxxxx sshd[15779]: debug1: inetd sockets after dupping: 3, 3 
Jul 4 13:15:40 vpsxxxxx sshd[15779]: Connection from 176.188.xx.xx port 64160 
Jul 4 13:15:40 vpsxxxxx sshd[15779]: debug1: Client protocol version 2.0; client software version OpenSSH_7.5 
Jul 4 13:15:40 vpsxxxxx sshd[15779]: debug1: match: OpenSSH_7.5 pat OpenSSH* 
Jul 4 13:15:40 vpsxxxxx sshd[15779]: debug1: Enabling compatibility mode for protocol 2.0 
Jul 4 13:15:40 vpsxxxxx sshd[15779]: debug1: Local version string SSH-2.0-OpenSSH_5.3 
Jul 4 13:15:40 vpsxxxxx sshd[15780]: debug1: permanently_set_uid: 74/74 
Jul 4 13:15:40 vpsxxxxx sshd[15780]: debug1: list_hostkey_types: ssh-rsa,ssh-dss 
Jul 4 13:15:40 vpsxxxxx sshd[15780]: debug1: SSH2_MSG_KEXINIT sent 
Jul 4 13:15:40 vpsxxxxx sshd[15780]: debug1: SSH2_MSG_KEXINIT received 
Jul 4 13:15:40 vpsxxxxx sshd[15780]: debug1: kex: client->server aes128-ctr [email protected] [email protected] 
Jul 4 13:15:40 vpsxxxxx sshd[15780]: debug1: kex: server->client aes128-ctr [email protected] [email protected] 
Jul 4 13:15:40 vpsxxxxx sshd[15780]: debug1: SSH2_MSG_KEX_DH_GEX_REQUEST received 
Jul 4 13:15:40 vpsxxxxx sshd[15780]: debug1: SSH2_MSG_KEX_DH_GEX_GROUP sent 
Jul 4 13:15:40 vpsxxxxx sshd[15780]: debug1: expecting SSH2_MSG_KEX_DH_GEX_INIT 
Jul 4 13:15:40 vpsxxxxx sshd[15780]: debug1: SSH2_MSG_KEX_DH_GEX_REPLY sent 
Jul 4 13:15:40 vpsxxxxx sshd[15780]: debug1: SSH2_MSG_NEWKEYS sent 
Jul 4 13:15:40 vpsxxxxx sshd[15780]: debug1: expecting SSH2_MSG_NEWKEYS 
Jul 4 13:15:40 vpsxxxxx sshd[15780]: debug1: SSH2_MSG_NEWKEYS received 
Jul 4 13:15:40 vpsxxxxx sshd[15780]: debug1: KEX done 
Jul 4 13:15:40 vpsxxxxx sshd[15780]: debug1: userauth-request for user userx service ssh-connection method none 
Jul 4 13:15:40 vpsxxxxx sshd[15780]: debug1: attempt 0 failures 0 
Jul 4 13:15:40 vpsxxxxx sshd[15779]: debug1: PAM: initializing for "userx" 
Jul 4 13:15:40 vpsxxxxx sshd[15779]: debug1: PAM: setting PAM_RHOST to "176.188.xx.xx" 
Jul 4 13:15:40 vpsxxxxx sshd[15779]: debug1: PAM: setting PAM_TTY to "ssh" 
Jul 4 13:15:40 vpsxxxxx sshd[15780]: debug1: userauth_send_banner: sent 

これを間違った方法で解釈していない限り、クライアント側のMercurialは、まだ開かれていない通信回線でコマンドを送信している間に、ユーザーがまだ認証されていないようです認証された。

+0

'-vvv'スイッチを' ssh'に追加します。 – Jakuje

+0

'-vvv'は' hg push 'とは何の効果もありませんでしたが、hgが実行するコマンドの手動実行に影響しました。 – AbVog

答えて

0

私はSSHの使用でついに成功しました(もう1年前にやったことがあります)。

問題は、OpenSSHパッケージのssh.exeを使用しているかのようです(または、これは私が今日読んできた以下のウェブページに記載されており、この泥沼から私を助けてくれました)まだ。しかし、質問に記載されているように、パテ、MobaXterm、ssh.exeを介した多数の以前の接続に加えて、手動でサーバーに接続していました。

パテパッケージといくつかの設定が必要です(https://www.mercurial-scm.org/wiki/WindowsInstall参照)。

参考文献:

特に二つ目は簡潔であり、ほとんどの私を助けました。この時点で

、ここに私の.hgrcファイルの関連内容は次のとおりです。HTTPSではなく、私はSSHに変換してる私のローカルリポジトリの

[ui] 
... 
ssh = D:\Programs\putty\plink.exe -ssh -agent -2 -C -i "path-to-ppk-file" 

hgrcファイルが含まれています

[paths] 
default-push=ssh://[email protected]:1234//var/hgrepos/projectx 

MercurialはそのURIを分解し、適切なパラメータをui.sshに示されたコマンドに提示することに注意してください。たとえば、hg clone ssh://[email protected]:1234//var/hgrepos/projectxは、コマンドラインウィンドウで次の出力を出力します。

G:\Data\Temp>hg clone ssh://[email protected]:1234//var/hgrepos/projectx 
running D:\Programs\putty\plink.exe -ssh -agent -2 -C -i "path-to-ppk-file" [email protected] -P 1234 "hg -R /var/hgrepos/projectx serve --stdio" 
sending hello command 
sending between command 
remote: 329 
remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch stream bundle2=HG20%0Achangegroup%3D01%2C02%0Adige 
sts%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2 
Chttps unbundle=HG10GZ,HG10BZ,HG10UN 
remote: 1 
destination directory: projectx 
query 1; heads 
sending batch command 
requesting all changes 
sending getbundle command 
bundle2-input-bundle: with-transaction 
bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported 
adding changesets 
add changeset 279e0cde0d10 
.... 
関連する問題