Question

Phing running on Server A, with this SSH task to connect to server B:

<ssh username="xxxxxx"
host="B"
pubkeyfile="/home/xxxx/.ssh/id_rsa.pub"
privkeyfile="/home/xxxx/.ssh/id_rsa.pem"
command="cd ./public_html/staging; hg pull />

It connects to server B ok, but the hg pull which tries to connect to server C spits back remote: Permission denied (public key).

However manually SSH'ing into server B from A and doing an hg pull works fine, suggesting Agent Forwarding is working as I'm not running any agent on B, only on A.

Is there a way I can see which public key is indeed being used by B to try to debug this?

Was it helpful?

Solution

It seems like agent forwarding is not supported by PHP's SSH2 which Phing's task uses.

Replacing the <ssh> task with a simple exec task, i.e.,

<exec command="ssh xxxxxx@B 'cd ./public_html/staging; hg pull'"/>

did the trick.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top