使用Shell脚本在不同服务器上交换文件的有效方法有哪些?

发布于 2024-07-26 05:46:31 字数 99 浏览 2 评论 0原文

我想使用自动脚本和不同服务器上的目标文件来更新服务器中的某些文件。 还没开始,不过我想这个过程中会出现授权和连接的问题。 关于我如何处理有什么建议吗?

谢谢

I want to update some file in a server, with an automated script and the target files on a different server. Haven't started yet, but I think there will be authorization and connection issues during the process. Any suggestion on how I could approach?

Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦里人 2024-08-02 05:46:31

设置 ssh 密钥,这样您就不需要密码。 然后您可以使用 scprsync

更复杂的系统:

Set up ssh keys so that you do not need a password. You can then use scp or rsync.

More sophisticated systems:

凉墨 2024-08-02 05:46:31
  • 最简单的解决方案是跨服务器交叉安装文件系统(例如 NFS)。
  • 如果您的服务器支持 rcp/rsh,您可以使用 .rhosts 文件来允许自动连接。
  • 如果只有 ssh/sftp/scp 可用,Google 提供自动 ssh/sftp - 这是可行的,但设置起来比较棘手。
  • Easiest solution is cross-mounting the filesystem (e.g. NFS) across servers.
  • If your servers support rcp/rsh, you can use .rhosts file to allow automated connection.
  • If only ssh/sftp/scp is available, Google for automated ssh/sftp - it is doable but trickier to set up.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文