MacRuby:与 net/ssh 的 SSH 连接?
我正在寻找使用 ssh 创建连接,以便在远程服务器上执行某些命令。
我想使用以下 gem 执行这些操作:net/ssh。
但它似乎不适用于 MacRuby。
你对此有何建议?
我希望我的应用程序能够在 AppStore 上发布。
I'm looking for creating a connection using ssh in order to execute some command on a remote server.
I wanted to perform these action with the following gem: net/ssh.
But it seems to don't be working with MacRuby.
What would you propose for it?
I would like my application to be released on the AppStore.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您考虑过使用 NSTask 吗?通过 NSTask 发送 ssh 命令非常容易。请参阅 http://www.cocoadev.com/index.pl?NSTask 上的示例(当然,您必须将调用翻译为macruby 等效项)。
优点是,这样您就不会依赖外部库/gems,因此您的应用程序将更容易在 Mac 应用程序商店中被接受。
Have you considered using an NSTask? it is pretty easy to dispatch an ssh command by means of an NSTask. See examples on http://www.cocoadev.com/index.pl?NSTask (of course you'd have to translate calls in macruby equivalents).
The advantage is that this way you would not depend on external libraries/gems, so your app would be more easily accepted on the mac app store.
试试这个:
这将在远程主机上执行
$ touch tmp/test.txt
。Try this:
This will execute
$ touch tmp/test.txt
on the remote host.