如何从我的网站/Web 应用程序连接到安全的 FtP?
我正在制作一个网站/网络应用程序,每 5 分钟左右显示一次图像,有点像网络摄像头。图像上传到 SFTP 服务器。我如何从网络访问这些内容?有人对使用什么有什么建议吗?现在我正在研究 PHP,但也检查了 javascript 和 ruby。只有应用程序需要 ssh 到预定位置,用户不需要。
朋友建议我使用 rsync 并设置无密码 ssh。有人这样做过吗?或者这是一个坏主意?
I'm working on making a website/web application that displays images every 5 or so minutes, kinda like a webcam. The images are uploaded to an SFTP server. How can I access those from the web? Does anyone have any recommendations for what to use as well? Right now I'm looking at PHP but have checked out javascript and ruby as well. Only the application needs to ssh to a predetermined place, not the users.
I was suggested by a friend to use rsync and setup passwordless ssh. Anyone ever do this? or is this a bad idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
cURL 具有 SFTP 支持。
cURL has SFTP support.
PHP 支持 SFTP。您需要安装 ssh2 扩展,
http://www.php.net/manual /en/book.ssh2.php
PHP supports SFTP. You need to install ssh2 extension,
http://www.php.net/manual/en/book.ssh2.php
如果应用程序是唯一需要 SSH 的东西,那么您可以立即排除 javascript。在这些环境中,它主要是一种客户端语言。
您可能喜欢 Net::SSH ruby 库,或者我确信有一个 php 等效项。我使用过 Net:SSH,它相当简单。
If the application is the only thing that needs to SSH then you can rule out javascript immediately. It's predominately a client-side language in these environments.
You may like at Net::SSH ruby library, or I'm sure there's a php equivalent. I have used Net:SSH and it's fairly straight forward.
您需要编写一个服务器端脚本来连接到 SFTP 服务器并将图像转发到客户端。
You need to write a server-side script that connects to the SFTP server and forwards the image to the client.