如何将 sftp 与 SAP 结合使用?

发布于 2024-08-21 18:43:11 字数 870 浏览 6 评论 0原文

目前我们使用FTP,但有要求使用SFTP。根据我们的 Basis 人员的说法,SFTP 将无法工作。我们有几个替代方案:

  • 使用 PI
  • 使用 Unix 脚本来移动文件

但是,我们是否缺少一些东西,使我们能够以与 FTP 类似的方式使用 SFTP?

调用 FTP 的代码示例:

  CALL FUNCTION 'HTTP_SCRAMBLE'  
    EXPORTING  
      SOURCE      = i_password
      sourcelen   = dstlen
      key         = c_key
    IMPORTING
      destination = lw_password.

  CLEAR: ftp_hdl, o_file.
  CALL FUNCTION 'FTP_CONNECT'
    EXPORTING
      user            = i_user
      password        = lw_password
      host            = i_host
      rfc_destination = c_rfcdest_sapftp
    IMPORTING
      handle          = ftp_hdl
    EXCEPTIONS
      not_connected   = 1
      OTHERS          = 2.

RFC 目标 c_rfcdest_sapftp 在 SM59 中定义如下:

连接类型:T (TCP/IP)
激活类型:在前端工作站启动
程序:sapftp(该程序有 SFTP 变体吗?)
启动类型:默认网关

Currently we use FTP, but there is a requirement to use SFTP. According to our Basis guys SFTP will not work. We have a couple of alternatives:

  • Use PI
  • Use a Unix script to move the files

However, is there something we are missing that would enable us to use SFTP in a similar way to FTP?

Example of code calling FTP:

  CALL FUNCTION 'HTTP_SCRAMBLE'  
    EXPORTING  
      SOURCE      = i_password
      sourcelen   = dstlen
      key         = c_key
    IMPORTING
      destination = lw_password.

  CLEAR: ftp_hdl, o_file.
  CALL FUNCTION 'FTP_CONNECT'
    EXPORTING
      user            = i_user
      password        = lw_password
      host            = i_host
      rfc_destination = c_rfcdest_sapftp
    IMPORTING
      handle          = ftp_hdl
    EXCEPTIONS
      not_connected   = 1
      OTHERS          = 2.

RFC Destination c_rfcdest_sapftp is defined as follows in SM59:

Connection Type: T (TCP/IP)
Activation Type: Start on Front-end Work Station
Program: sapftp (Is there a SFTP variant of the program?)
Start Type: Default Gateway

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

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

发布评论

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

评论(2

陌上青苔 2024-08-28 18:43:12

奇怪的是,SAP 并不支持开箱即用的 SFTP。据我了解,PI 将使用 FTPS(我相信这是不同的) 至少有一家公司向 PI 出售第三方附加组件以使用 SFTP。快速谷歌一下就会找到它。这就是我们必须在这里做的才能获得 SFTP 和 SFTP 服务。 PGP 加密文件,无需调用操作系统脚本。

编辑:这不再是一个真实的陈述。请参阅下面的评论。

As odd as it is, SAP doesn't support SFTP out of the box. As I understand it, PI will do FTPS (which is different, I believe) There is at least one company selling a 3rd party bolt-on to PI to use SFTP. A quick Google will turn it up. That is what we had to do here to get SFTP & PGP encrypted files without invoking OS scripts.

EDIT: This is no longer a true statement. Please see the comments below.

十年不长 2024-08-28 18:43:12

起初我认为这也很烦人,SAP PI 无法处理 SFTP。无论如何,如果你看一下协议,就会发现它是通过 ssh 建立隧道的 ftp。目前,安全社区正在转向 ftps,因为该协议不允许其他协议的隧道传输,因此被认为更安全。也许您应该考虑建立 ftp,因为它是一个不错的选择。如果您仅使用 PI 作为公司内部的中间件,或者您没有任何可从外部访问的 FTP 服务,那么这是切换到 ftps 的好机会。

问候

马蒂亚斯·奈斯尔

At first I thought that this is also annoying, that the SAP PI cannot handle SFTP. Anyway, if you look at the protocol, it's ftp tunneled through ssh. At the moment there is a movement in the security community to ftps, due to the fact, that this protocol does not allow tunneling of other protocols and therefore is considered as more secure. Maybe you should think about establishing ftps, as it's a good alternative. If you are only using the PI as a middleware within the company or you don't have any FTP service which is accessible from outside it's a good chance to switch to ftps.

Regards

Matthias Kneissl

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文