Problem with accessing remote Git repositories using SSH

Recently I've got pretty strange problem with working with Git repositories from PHPStorm.

OS is Windows 7 x64.

Everything was working fine with PHPStorm 7.1.3, but (most likely) after update to last EAP of PHPStorm 8 and 8.0 release I've started experiencing problems with running any network operations (e.g. pull, push) for Git repositories that are cloned using SSH and public key. E.g. attempt to pull from GitHub repository gives me:

12:54:41.496: git fetch origin --progress --prune

FATAL ERROR: Disconnected: No supported authentication methods available (server sent: publickey)

fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

while same operation from windows command prompt works properly.

Git is registered properly in PHPStorm, use of native SSH client is selected.

SSH keys are served by pageant, plink is used as ssh client, GIT_SSH environment variable is set properly.

Clean reinstall of PHPStorm 7.1.3 without use of previous application settings doesn't help.

Same operations from PHPStorm are working properly on same repository if it is cloned through HTTPS rather then SSH. From windows cmd both ways are working properly.

Turning Windows Firewall on and off doesn't affect situation anyhow.

Test with repository served by gitolite and sshd log severity set to debug2 shows that when repository is accessed by PHPStorm it disconnects almost immediately:

Sep 18 11:56:24 dev sshd[30233]: debug1: matching key found: file /home/git/.ssh/authorized_keys, line 5
Sep 18 11:56:24 dev sshd[30233]: Found matching RSA key: e5:10:7f:55:de:19:83:11:50:54:8c:63:4a:63:a4:ed
Sep 18 11:56:24 dev sshd[30233]: debug1: restore_uid: 0/0
Sep 18 11:56:24 dev sshd[30233]: debug2: userauth_pubkey: authenticated 0 pkalg ssh-rsa [preauth]
Sep 18 11:56:24 dev sshd[30233]: Postponed publickey for git from xx.xx.xx.xx port 50577 ssh2 [preauth]
Sep 18 11:56:24 dev sshd[30233]: Received disconnect from xx.xx.xx.xx: 13: Unable to authenticate [preauth]
Sep 18 11:56:24 dev sshd[30233]: debug1: do_cleanup [preauth]

while when same repository is accessed through windows cmd - it proceeds with authentication properly:

Sep 18 11:53:46 dev sshd[30193]: debug1: matching key found: file /home/git/.ssh/authorized_keys, line 5
Sep 18 11:53:46 dev sshd[30193]: Found matching RSA key: e5:10:7f:55:de:19:83:11:50:54:8c:63:4a:63:a4:ed
Sep 18 11:53:46 dev sshd[30193]: debug1: restore_uid: 0/0
Sep 18 11:53:46 dev sshd[30193]: debug2: userauth_pubkey: authenticated 0 pkalg ssh-rsa [preauth]
Sep 18 11:53:46 dev sshd[30193]: Postponed publickey for git from xx.xx.xx.xx port 50517 ssh2 [preauth]
Sep 18 11:53:46 dev sshd[30193]: debug1: userauth-request for user git service ssh-connection method publickey [preauth]
Sep 18 11:53:46 dev sshd[30193]: debug1: attempt 2 failures 0 [preauth]
Sep 18 11:53:46 dev sshd[30193]: debug2: input_userauth_request: try method publickey [preauth]
Sep 18 11:53:46 dev sshd[30193]: debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-1024
Sep 18 11:53:46 dev sshd[30193]: debug1: Checking blacklist file /etc/ssh/blacklist.RSA-1024
Sep 18 11:53:46 dev sshd[30193]: debug1: temporarily_use_uid: 1002/1002 (e=0/0)
Sep 18 11:53:46 dev sshd[30193]: debug1: trying public key file /home/git/.ssh/authorized_keys
Sep 18 11:53:46 dev sshd[30193]: debug1: matching key found: file /home/git/.ssh/authorized_keys, line 5
Sep 18 11:53:46 dev sshd[30193]: Found matching RSA key: e5:10:7f:55:de:19:83:11:50:54:8c:63:4a:63:a4:ed
Sep 18 11:53:46 dev sshd[30193]: debug1: restore_uid: 0/0
Sep 18 11:53:46 dev sshd[30193]: debug1: ssh_rsa_verify: signature correct
Sep 18 11:53:46 dev sshd[30193]: debug1: do_pam_account: called
Sep 18 11:53:46 dev sshd[30193]: Accepted publickey for git from xx.xx.xx.xx port 50517 ssh2
Sep 18 11:53:46 dev sshd[30193]: debug2: userauth_pubkey: authenticated 1 pkalg ssh-rsa [preauth]
Sep 18 11:53:46 dev sshd[30193]: debug1: monitor_read_log: child log fd closed
Sep 18 11:53:46 dev sshd[30193]: debug1: monitor_child_preauth: git has been authenticated by privileged process

Any ideas what else can be checked or how to fix this problem?
1 comment
Comment actions Permalink

Accidentally I found the reason by myself :) Previously I've run PHPStorm from Administrator account (by setting corresponding checkbox in application's shortcut) but after upgrade this checkbox was not set and running PHPStorm from regular user was not enough to allow Git to access Pageant. Maybe real underlying problem is slightly different, but running PHPStorm from Administrator solves the problem.

0

Please sign in to leave a comment.