Phing SSH 代理转发

编程入门 行业动态 更新时间:2024-10-28 00:19:44
本文介绍了Phing SSH 代理转发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

Phing 在服务器 A 上运行,使用此 SSH 任务连接到服务器 B:

它连接到服务器 B ok,但是尝试连接到服务器 C 的 hg pull 吐回 remote: Permission denied (public key).

但是,从 A 手动 SSH 连接到服务器 B 并执行 hg pull 工作正常,这表明代理转发正在工作,因为我没有在 B 上运行任何代理,仅在 A 上运行.

有什么方法可以让我看到 B 确实在使用哪个公钥来尝试调试它?

解决方案

Phing 的任务使用的 PHP SSH2 似乎不支持代理转发.

用一个简单的 exec 任务替换 任务,即,

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

成功了.

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?

解决方案

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.

更多推荐

Phing SSH 代理转发

本文发布于:2023-10-07 12:34:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1469394.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Phing   SSH

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!