Phing SSH Agent forwarding

。_饼干妹妹 提交于 2019-12-12 01:09:18

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/21419254/phing-ssh-agent-forwarding

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!