abrendalson
New Member
I have built a php script that performs a git fetch on a specific folder:the exact command is : \[code\]usr/bin/git --git-dir=/home/bathan/www/sync_test/repo3//.git --work-tree=/home/bathan/www/sync_test/repo3/ fetch\[/code\]Of course, if I run this on the command line it works perfectly.Now, when I run this using shell_exec I get the following error:\[quote\]\[code\]Permission denied, please try again.Permission denied, please try again.Permission denied (publickey,gssapi-with-mic,password).fatal: The remote end hung up unexpectedly\[/code\]\[/quote\]Looking into the server its trying to connect, the exact error is : \[quote\] Apr 8 10:52:17 myserver sshd[26230]: Failed password for git from 192.15.136.253 port 32878 ssh2\[/quote\]So, Ok. I guess that this shell_exec is not able to read the ~/.ssh/id_rsa key I have set up. So I give 777 permission to that file and i get this error.\[quote\] @@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@ Permissions 0777 for '/home/bathan/.ssh/id_rsa' are too open. It is recommended that your private key files are NOT accessible by others. This private key will be ignored. bad permissions: ignore key: /home/bathan/.ssh/id_rsa Permission denied, please try again. Permission denied, please try again. Permission denied (publickey,gssapi-with-mic,password). fatal: The remote end hung up unexpectedly\[/quote\]So I guess that git IS able to read the key file. If I put it back to the correct permissions I go back again to the first error.Note : my apache server is set to run with my same user (bathan) and this is an ubuntu box.This is the ssh -v Response\[code\]OpenSSH_5.5p1 Debian-4ubuntu5, OpenSSL 0.9.8o 01 Jun 2010Pseudo-terminal will not be allocated because stdin is not a terminal.debug1: Reading configuration data /home/bathan/.ssh/configdebug1: Applying options for gitserverdebug1: Reading configuration data /etc/ssh/ssh_configdebug1: Applying options for *debug1: Connecting to git.myserver.com [77.171.171.229] port 22.debug1: Connection established.debug1: identity file /home/bathan/.ssh/id_rsa type 1debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-1023debug1: Checking blacklist file /etc/ssh/blacklist.RSA-1023debug1: identity file /home/bathan/.ssh/id_rsa-cert type -1debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3debug1: match: OpenSSH_4.3 pat OpenSSH_4*debug1: Enabling compatibility mode for protocol 2.0debug1: Local version string SSH-2.0-OpenSSH_5.5p1 Debian-4ubuntu5debug1: SSH2_MSG_KEXINIT sentdebug1: SSH2_MSG_KEXINIT receiveddebug1: kex: server->client aes128-ctr hmac-md5 nonedebug1: kex: client->server aes128-ctr hmac-md5 nonedebug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sentdebug1: expecting SSH2_MSG_KEX_DH_GEX_GROUPdebug1: SSH2_MSG_KEX_DH_GEX_INIT sentdebug1: expecting SSH2_MSG_KEX_DH_GEX_REPLYdebug1: Host 'git.myserver.com' is known and matches the RSA host key.debug1: Found key in /home/bathan/.ssh/known_hosts:4debug1: ssh_rsa_verify: signature correctdebug1: SSH2_MSG_NEWKEYS sentdebug1: expecting SSH2_MSG_NEWKEYSdebug1: SSH2_MSG_NEWKEYS receiveddebug1: Roaming not allowed by serverdebug1: SSH2_MSG_SERVICE_REQUEST sentdebug1: SSH2_MSG_SERVICE_ACCEPT receiveddebug1: Authentications that can continue: publickey,gssapi-with-mic,passworddebug1: Next authentication method: gssapi-with-micdebug1: Unspecified GSS failure. Minor code may provide more informationCredentials cache file '/tmp/krb5cc_1000' not found....\[/code\]Any Ideas?