有人知道ssh .vs的V2版本中对应的命令是什么吗?V1的:
chan.send_request“外壳”,空,true
谢谢!丹
发布于 2012-04-28 23:08:25
它是send_channel_request。
例如,要在Ruby中测试github连接:
Net::SSH.start("github.com", "git", {}) do |session|
session.open_channel do |channel|
channel.on_extended_data do |ch, type, data|
next unless type == 1
warn data
end
channel.send_channel_request "shell"
end
session.loop
end链接的文档还提供了处理成功/失败的示例(在v1中传递的true参数和on_success/on_failure在v2中的处理方式不同)
https://stackoverflow.com/questions/6692474
复制相似问题