<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Graversen &#187; ssh</title>
	<atom:link href="http://graversen.org/tag/ssh/feed/" rel="self" type="application/rss+xml" />
	<link>http://graversen.org</link>
	<description>Daniels comments</description>
	<lastBuildDate>Thu, 19 Aug 2010 21:50:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Using SFTP for windows in PI</title>
		<link>http://graversen.org/2009/07/29/using-sftp-for-windows-in-pi/</link>
		<comments>http://graversen.org/2009/07/29/using-sftp-for-windows-in-pi/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 19:20:12 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[pi]]></category>
		<category><![CDATA[sap]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://graversen.org/2009/07/29/using-sftp-for-windows-in-pi/</guid>
		<description><![CDATA[SAP Process Integration (PI) does not have the ability to fetch data from a SFTP server running the SSH protocol. This script will make it possible to fetch data via SSH SFTP. ]]></description>
			<content:encoded><![CDATA[<p>Last December I <a href="https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/12426">wrote</a> about how to use SFTP SSH from a Unix server, without using a Seeburger Adapter. SAP PI/XI cannot be used to access SSH SFTP sites directly, but this script can help. There have been many requests for a version which also works on windows. I do not have access to a windows server with PI or XI so it is a little difficult to test for me.
</p>
<p>I have now written the following script, which works on my Vista labtop. I have not tested it on Windows 2003 or Windows 2008, where most PI systems will run.
</p>
<p>I have used <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">Putty</a> for creating the SSH connection. I have used the <a href="http://the.earth.li/~sgtatham/putty/latest/x86/pscp.exe">pscp</a> (an SCP client, i.e. command-line secure file copy). To try something different then using SFTP. SCP makes it easier to get files which should exist in a directory.  Pscp should be downloaded and saved in the same directory as the script.     
</p>
<p>The script looks like the following.
</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">@echo off<br />
REM PARAMETERS<br />
REM %1 target file &nbsp;PI %F<br />
REM %2 query for where the file is located ie. root@figaf.com:dir/* <br />
REM %3 SSH Password<br />
<br />
REM RESET the target file <br />
echo '' &gt;%1<br />
<br />
<br />
SET TARGETDIR=%~d1%~p1download<br />
echo %TARGETDIR%<br />
<br />
IF EXIST %TARGETDIR% GOTO SKIPCREATEDIR<br />
&nbsp; &nbsp;mkdir &nbsp;%TARGETDIR%<br />
:SKIPCREATEDIR<br />
del /Q %TARGETDIR%\*<br />
<br />
<br />
pscp.exe -pw %3 %2 %TARGETDIR%<br />
<br />
type &nbsp;%TARGETDIR%\* &gt; %1</div></div>
<p>The script takes the following parameters.
</p>
<ol>
<li>The %F which is the name of the file, which the adapter is currently reading.
</li>
<li>A the location of the file on the server side in the form &#8220;user@server:path/[filter*] ie. root@sftp.figaf.com:dir/SKB*. This command logon with the user root on the host sftp.figaf.com. Then looks in the directory dir, relative to the login dir and the selects all files starting with SKB.
</li>
<li>The users password.
</li>
</ol>
<p>The command in the communication channel  should look something like.
</p>
<p><em>C:\scripts\sshftp.bat %F  </em>root@sftp.figaf.com:dir/SKB*. <em><br />
		</em></p>
<p>I have only tested with password, but pscp might also work with using ssh keys.</p>
]]></content:encoded>
			<wfw:commentRss>http://graversen.org/2009/07/29/using-sftp-for-windows-in-pi/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
