Jump to content

SFTP Feature Product Bulletin: Difference between revisions

From DocDepot
GMalcom (talk | contribs)
Created page with "<div><p>SFTP (Secure File Transfer Protocol) feature is an optional module that provides encrypted consist and maintenance transport from the APU102 to a host system.</p> This document describes the installation and configuration of the SFTP client feature.</div> The described procedures are “generic”. Customer-specific procedures are described elsewhere.<p><br></p> ==== Supported Hardware ==== The SFTP feature requires the LX800 processor module; the LPM-TX proc..."
 
GMalcom (talk | contribs)
 
(11 intermediate revisions by the same user not shown)
Line 3: Line 3:
This document describes the installation and configuration of the SFTP client feature.</div>
This document describes the installation and configuration of the SFTP client feature.</div>


 
The described procedures are “generic”. Customer-specific procedures are described elsewhere.
 
The described procedures are “generic”. Customer-specific procedures are described elsewhere.<p><br></p>
==== Supported Hardware ====
==== Supported Hardware ====
The SFTP feature requires the LX800 processor module; the LPM-TX processor is not supported.
The SFTP feature requires the LX800 processor module; the LPM-TX processor is not supported.
Line 11: Line 9:
<p>This document covers installation of the SFTP update and describes authentication (login) to an SFTP server.</p>
<p>This document covers installation of the SFTP update and describes authentication (login) to an SFTP server.</p>
==== See Also ====
==== See Also ====
<p>To use public-private key authentication, see provided [[#Sample BAT File]].</p><p><br></p>
<p>To use public-private key authentication, see provided [[#Sample BAT File|Sample BAT File]].</p>
 
= Installation =
= Installation =
<p>The update payload is large so a fast and reliable link is required for installation.<br><br></p>
<p>The update payload is large so a fast and reliable link is required for installation.<br><br></p>
Line 29: Line 28:
<p><br></p>
<p><br></p>
===== Installation Details =====
===== Installation Details =====
<p>Installation involves two steps: uploading the update payload (the three files noted earlier) and rebooting the APU102 to complete installation. The following shows step-by-step instructions for each of the supported upload methods.</p><p><br></p><p>Three files are sent to the APU102:</p><p style="margin-left: 25px;" >INSTSFTP.EXE<br>F.BAT<br>ZIP.PSP</p><p><br></p>
<p>Installation involves two steps: uploading the update payload (the three files noted earlier) and rebooting the APU102 to complete installation. The following shows step-by-step instructions for each of the supported upload methods.</p><p>Three files are sent to the APU102:</p><p style="margin-left: 25px;" >INSTSFTP.EXE<br>F.BAT<br>ZIP.PSP</p>
====== Telnet ======
====== Telnet ======
<p>If Telnet connections are permitted, the ZREC command may be used to upload the update payload. (Note: ZMODEM over SSH is not reliable in the current software.)</p><p><br></p>
<p>If Telnet connections are permitted, the ZREC command may be used to upload the update payload. (Note: ZMODEM over SSH is not reliable in the current software.)</p>
#Connect to the APU102 using a Telnet client such as Tera Term.
#Connect to the APU102 using a Telnet client such as Tera Term.
#Login to Session #1 and use the C command to enter Change mode.
#Login to Session #1 and use the C command to enter Change mode.
#For each of the three files, use the ZREC command and then send the file using ZMODEM transfer
#For each of the three files, use the ZREC command and then send the file using ZMODEM transfer
#Reboot the APU102 (R command).<br><br>
#Reboot the APU102 (R command).
 
====== FTP ======
====== FTP ======
<p>If the FTP server on the APU102 is enabled, an FTP client such as WinSCP or FileZilla may be used to send the update.</p><p><br></p>
<p>If the FTP server on the APU102 is enabled, an FTP client such as WinSCP or FileZilla may be used to send the update.</p>
#Open an FTP session using the IP address for the APU102 being updated.
#Open an FTP session using the IP address for the APU102 being updated.
#Login using credentials provided by Comet.
#Login using credentials provided by Comet.
Line 47: Line 45:
#Login to Session #1 and use the C command to enter Change mode.
#Login to Session #1 and use the C command to enter Change mode.
#Reboot the APU102 (R command).
#Reboot the APU102 (R command).
<p><br></p>
====== SCP ======
====== SCP ======
<p>If SSH is enabled, an SCP client such as WinSCP may be used to upload the update payload.</p>
<p>If SSH is enabled, an SCP client such as WinSCP may be used to upload the update payload.</p>
Line 58: Line 55:
#Login to Session #1 and use the C command to enter Change mode.
#Login to Session #1 and use the C command to enter Change mode.
#Reboot the APU102 (R command).
#Reboot the APU102 (R command).
<p><br></p>
 
= Configuration =
= Configuration =
<p>Configuration is customer specific. Consult Comet for guidance.</p>
<p>Configuration is customer specific. Consult Comet for guidance.</p>


In general, configuration consists of installing appropriate access (ACC) files describe how the APU102 is to deliver consist and maintenance reports to a server. Parameters for report delivery are changed to specify the appropriate SFTP ACC files (AEIReportConnect and MaintReportConnect settings accessed using the EP command).<p>In the case of SFTP, the ACC file specifies that the APU executes a BAT (batch) file which consists of a list of Windows commands to prepare and deliver the report payload.</p><p>These BAT files are customized to meet each customer’s requirements. See [[#Sample Bat File]] for an example.</p><p><br></p>
In general, configuration consists of installing appropriate access (ACC) files describe how the APU102 is to deliver consist and maintenance reports to a server. Parameters for report delivery are changed to specify the appropriate SFTP ACC files (AEIReportConnect and MaintReportConnect settings accessed using the EP command).<p>In the case of SFTP, the ACC file specifies that the APU executes a BAT (batch) file which consists of a list of Windows commands to prepare and deliver the report payload.</p><p>These BAT files are customized to meet each customer’s requirements. See [[#Sample BAT File|Sample BAT File]] for an example.</p><p><br></p>
====== Testing ======
====== Testing ======


Line 68: Line 65:
#Verify that the events are correctly reported to the railroad host system.<br><br>
#Verify that the events are correctly reported to the railroad host system.<br><br>


= Procedure Complete.<br><br>Description of Changes =
Procedure Complete.
= Description of Changes =
<p>This update includes:</p>
<p>This update includes:</p>
*- Updated “curl.exe” package
*- Updated “curl.exe” package
*- Updated report delivery scripts (ACC files). The names of these files are the same is in previous configurations. The new scripts refer to BAT files that contain the commands using curl.exe to send files using SFTP protocol.<br>
*- Updated report delivery scripts (ACC files). The names of these files are the same is in previous configurations. The new scripts refer to BAT files that contain the commands using curl.exe to send files using SFTP protocol.<br>
<p>'''&nbsp;'''</p>
 
= Using WinSCP =
= Using WinSCP =
<p>WinSCP is available for download on the internet:</p>
<p>WinSCP is available for download on the internet:</p>
:[https://winscp.net/eng/index.php https://winscp.net/eng/index.php]<p><br></p>


:[https://winscp.net/eng/index.php https://winscp.net/eng/index.php]<p><br></p>
{| style="border-collapse: collapse; width: 821px; margin-left: auto; margin-right: auto;" border="1px" cellpadding="4px"
{| style="border-collapse: collapse; width: 821px; margin-left: auto; margin-right: auto;" border="1px" cellpadding="4px"
|-
|-  
| style="width: 811.266px; background-color: rgb(241, 196, 15);" | <p>'''Disclaimer'''</p>
| style="width: 811.266px; background-color: rgb(241, 196, 15);" | <p>'''Disclaimer'''</p>
|-
|-  
| style="width: 811.266px;" | <p>Comet Electronics makes no guarantees whatsoever regarding the suitability or security of any third-party software such as WinSCP, PuTTY, or TeraTerm. '''Use at your own risk.'''</p><p>It is up to the user to establish that software is genuine, properly licensed, and compliant with any company Information Technology (IT) policies.</p><p>'''Contact your IT department for guidance.'''</p>
| style="width: 811.266px;" | <p>Comet Electronics makes no guarantees whatsoever regarding the suitability or security of any third-party software such as WinSCP, PuTTY, or TeraTerm. '''Use at your own risk.'''</p>
<p>It is up to the user to establish that software is genuine, properly licensed, and compliant with any company Information Technology (IT) policies.</p>
<p>'''Contact your IT department for guidance.'''</p>
|}
|}
<p><br></p><p>WinSCP provides a graphical interface showing files on your PC and files on the remote system. Refer to WinSCP website for documentation. When uploading files to the APU102, ensure that /d/aei is the current directory (see illustration).</p><p><br></p><p>To connect with an APU102, you will need to know which protocols are supported: SCP, FTP, or both. Note: is it possible for an APU102 to be configured such that neither transfer protocol is supported.</p><p>[Image of WinSCP interface]</p>
 
<p><br></p>
<p>WinSCP provides a graphical interface showing files on your PC and files on the remote system. Refer to WinSCP website for documentation. When uploading files to the APU102, ensure that /d/aei is the current directory (see illustration).</p>
<p><br></p>
<p>To connect with an APU102, you will need to know which protocols are supported: SCP, FTP, or both. Note: is it possible for an APU102 to be configured such that neither transfer protocol is supported.</p>
[[image:img1738315039976.png|653px|center|frameless]]
 
= Authentication =
= Authentication =
<p>When connecting to an SFTP server, the APU102 (the client) is required to provide a username and either a password or private key.</p><p>If a key is to be used, the private key is installed on the APU102 and specified in the BAT file.</p><p>The corresponding public key is installed on the server in the “authorized_keys” file. This is server-specific (e.g. OpenSSH configuration may not be the same as other server software).</p>
<p>When connecting to an SFTP server, the APU102 (the client) is required to provide a username and either a password or private key.</p><p>If a key is to be used, the private key is installed on the APU102 and specified in the BAT file.</p><p>The corresponding public key is installed on the server in the “authorized_keys” file. This is server-specific (e.g. OpenSSH configuration may not be the same as other server software).</p>


<br><p><br></p>
= Sample BAT File =
= Sample BAT File =
<p>A sample BAT file is shown:</p><p><br></p><p style="margin-left: 25px;" >REM 1 - site index</p><p style="margin-left: 25px;" >REM 2 - filename</p><p style="margin-left: 25px;" >REM 3 - site name</p><p style="margin-left: 25px;" ><br></p><p style="margin-left: 25px;" >set OUTPUT=MYRR2CN.%1.TXT</p><p style="margin-left: 25px;" >set OUTPUT2=MYRR 2CN.2.%1.TXT</p><p style="margin-left: 25px;" >set OUTLOG=MYRR 2CN.%1.LOG</p><p style="margin-left: 25px;" ><br></p><p style="margin-left: 25px;" >del %OUTPUT%</p><p style="margin-left: 25px;" >del %OUTPUT2%</p><p style="margin-left: 25px;" >del %OUTLOG%</p><p style="margin-left: 25px;" ><br></p><p style="margin-left: 25px;" >REM be sure to keep the trailing '/' on the URL if specifying a directory!</p><p style="margin-left: 25px;" >curl -k -u someuser:somepassword -T %2 sftp://10.1.3.200/MYRR_TO_CNRR/ 1&gt; %OUTPUT% 2&gt; %OUTPUT2%</p><p style="margin-left: 25px;" ><br></p><p style="margin-left: 25px;" >REM check error level</p><p style="margin-left: 25px;" >if NOT %ERRORLEVEL% == 0 goto Failure</p><p style="margin-left: 25px;" ><br></p><p style="margin-left: 25px;" >REM create log file</p><p style="margin-left: 25px;" >:Success</p><p style="margin-left: 25px;" ><br></p><p style="margin-left: 25px;" >echo Status:success &gt; %OUTLOG%</p><p style="margin-left: 25px;" >echo Supporting info: &gt;&gt; %OUTLOG%</p><p style="margin-left: 25px;" >echo curl completed successfully &gt;&gt; %OUTLOG%</p><p style="margin-left: 25px;" ><br></p><p style="margin-left: 25px;" >goto End</p><p style="margin-left: 25px;" ><br></p><p style="margin-left: 25px;" >:Failure</p><p style="margin-left: 25px;" ><br></p><p style="margin-left: 25px;" >:CurlFailure</p><p style="margin-left: 25px;" ><br></p><p style="margin-left: 25px;" >echo Status:failure &gt; %OUTLOG%</p><p style="margin-left: 25px;" >echo Supporting info: &gt;&gt; %OUTLOG%</p><p style="margin-left: 25px;" ><br></p><p style="margin-left: 25px;" >strfunc -sf "curl:" %OUTPUT2%</p><p style="margin-left: 25px;" ><br></p><p style="margin-left: 25px;" >if %ERRORLEVEL% == 1 goto UnknownFailure</p><p style="margin-left: 25px;" ><br></p><p style="margin-left: 25px;" >strfunc -sf "curl:" %OUTPUT2% &gt;&gt; %OUTLOG%</p><p style="margin-left: 25px;" ><br></p><p style="margin-left: 25px;" >goto End</p><p style="margin-left: 25px;" ><br></p><p style="margin-left: 25px;" >:UnknownFailure</p><p style="margin-left: 25px;" ><br></p><p style="margin-left: 25px;" >echo Status:failure &gt; %OUTLOG%</p><p style="margin-left: 25px;" >echo Supporting info: &gt;&gt; %OUTLOG%</p><p style="margin-left: 25px;" >echo Curl had unexpected failure, check log file &gt;&gt; %OUTLOG%</p><p style="margin-left: 25px;" ><br></p><p style="margin-left: 25px;" >:End</p><p><br></p><p>The name of the BAT file must agree with the name of the ACC file. In other words, if the ACC file is called AEICRR1.ACC, the corresponding BAT file must be called AEICRR1.BAT. By convention, the log files (specified in the three set statements at the top of the BAT file have the same base filename (e.g.&nbsp; AEICRR1) as the ACC file.</p><p>If a key file is used in place of a password, the “curl” command should look like this:</p><p><br></p><p class="mwt-heading" >curl -k –key keyfilename.key -T %2 sftp://username@10.1.3.200/MYRR_TO_CNRR/ 1&gt; %OUTPUT% 2&gt; %OUTPUT2%'''<br>'''</p>
<p>A sample BAT file is shown:</p><p><br></p><p style="margin-left: 25px;"><span style="color: rgb(22, 145, 121);" >REM 1 - site index</span></p><p style="margin-left: 25px;"><span style="color: rgb(22, 145, 121);" >REM 2 - filename</span></p><p style="margin-left: 25px;"><span style="color: rgb(22, 145, 121);" >REM 3 - site name</span></p><p style="margin-left: 25px;"><br></p><p style="margin-left: 25px;"><span style="color: rgb(35, 111, 161);" >set OUTPUT=MYRR2CN.%1.TXT</span></p><p style="margin-left: 25px;"><span style="color: rgb(35, 111, 161);" >set OUTPUT2=MYRR 2CN.2.%1.TXT</span></p><p style="margin-left: 25px;"><span style="color: rgb(35, 111, 161);" >set OUTLOG=MYRR 2CN.%1.LOG</span></p><p style="margin-left: 25px;"><br></p><p style="margin-left: 25px;"><span style="color: rgb(35, 111, 161);" >del %OUTPUT%</span></p><p style="margin-left: 25px;"><span style="color: rgb(35, 111, 161);" >del %OUTPUT2%</span></p><p style="margin-left: 25px;"><span style="color: rgb(35, 111, 161);" >del %OUTLOG%</span></p><p style="margin-left: 25px;"><br></p><p style="margin-left: 25px;"><span style="color: rgb(22, 145, 121);" >REM be sure to keep the trailing '/' on the URL if specifying a directory!</span></p><p style="margin-left: 25px;"><span style="color: rgb(35, 111, 161);" >curl -k -u someuser:somepassword -T %2 sftp://10.1.3.200/MYRR_TO_CNRR/ 1&gt; %OUTPUT% 2&gt; %OUTPUT2%</span></p><p style="margin-left: 25px;"><br></p><p style="margin-left: 25px;"><span style="color: rgb(22, 145, 121);" >REM check error level</span></p><p style="margin-left: 25px;"><span style="color: rgb(35, 111, 161);" >if NOT %ERRORLEVEL% == 0 goto Failure</span></p><p style="margin-left: 25px;"><br></p><p style="margin-left: 25px;"><span style="color: rgb(22, 145, 121);" >REM create log file</span></p><p style="margin-left: 25px;"><span style="color: rgb(186, 55, 42);" >:Success</span></p><p style="margin-left: 25px;"><br></p><p style="margin-left: 25px;"><span style="color: rgb(35, 111, 161);" >echo Status:success &gt; %OUTLOG%</span></p><p style="margin-left: 25px;"><span style="color: rgb(35, 111, 161);" >echo Supporting info: &gt;&gt; %OUTLOG%</span></p><p style="margin-left: 25px;"><span style="color: rgb(35, 111, 161);" >echo curl completed successfully &gt;&gt; %OUTLOG%</span></p><p style="margin-left: 25px;"><br></p><p style="margin-left: 25px;"><span style="color: rgb(35, 111, 161);" >goto End</span></p><p style="margin-left: 25px;"><br></p><p style="margin-left: 25px;"><span style="color: rgb(186, 55, 42);" >:Failure</span></p><p style="margin-left: 25px;"><br></p><p style="margin-left: 25px;"><span style="color: rgb(186, 55, 42);" >:CurlFailure</span></p><p style="margin-left: 25px;"><br></p><p style="margin-left: 25px;"><span style="color: rgb(35, 111, 161);" >echo Status:failure &gt; %OUTLOG%</span></p><p style="margin-left: 25px;"><span style="color: rgb(35, 111, 161);" >echo Supporting info: &gt;&gt; %OUTLOG%</span></p><p style="margin-left: 25px;"><br></p><p style="margin-left: 25px;"><span style="color: rgb(35, 111, 161);" >strfunc -sf "curl:" %OUTPUT2%</span></p><p style="margin-left: 25px;"><br></p><p style="margin-left: 25px;"><span style="color: rgb(35, 111, 161);" >if %ERRORLEVEL% == 1 goto UnknownFailure</span></p><p style="margin-left: 25px;"><br></p><p style="margin-left: 25px;"><span style="color: rgb(35, 111, 161);" >strfunc -sf "curl:" %OUTPUT2% &gt;&gt; %OUTLOG%</span></p><p style="margin-left: 25px;"><br></p><p style="margin-left: 25px;"><span style="color: rgb(35, 111, 161);" >goto End</span></p><p style="margin-left: 25px;"><br></p><p style="margin-left: 25px;"><span style="color: rgb(186, 55, 42);" >:UnknownFailure</span></p><p style="margin-left: 25px;"><br></p><p style="margin-left: 25px;"><span style="color: rgb(35, 111, 161);" >echo Status:failure &gt; %OUTLOG%</span></p><p style="margin-left: 25px;"><span style="color: rgb(35, 111, 161);" >echo Supporting info: &gt;&gt; %OUTLOG%</span></p><p style="margin-left: 25px;"><span style="color: rgb(35, 111, 161);" >echo Curl had unexpected failure, check log file &gt;&gt; %OUTLOG%</span></p><p style="margin-left: 25px;"><br></p><p style="margin-left: 25px;"><span style="color: rgb(186, 55, 42);" >:End</span></p><p><br></p><p>The name of the BAT file must agree with the name of the ACC file. In other words, if the ACC file is called AEICRR1.ACC, the corresponding BAT file must be called AEICRR1.BAT. By convention, the log files (specified in the three set statements at the top of the BAT file have the same base filename (e.g.&nbsp; AEICRR1) as the ACC file.</p><p>If a key file is used in place of a password, the “curl” command should look like this:</p><p><br></p><p class="mwt-heading" style="margin-left: 25px;" ><span style="color: rgb(35, 111, 161);" >curl -k –key keyfilename.key -T %2 sftp://username@10.1.3.200/MYRR_TO_CNRR/ 1&gt; %OUTPUT% 2&gt; %OUTPUT2%</span><br></p>
 
= Converting PuTTY Key to OpenSSH =
= Converting PuTTY Key to OpenSSH =
<p>If a public-private key pair is creating using PuTTY, the private key file must be converted to a format usable to OpenSSH before installing on the APU102.</p>
<p>If a public-private key pair is creating using PuTTY, the private key file must be converted to a format usable to OpenSSH before installing on the APU102.</p>
{|
[[image:img1738340988024.png|250px|left|frameless|Figure 1]]
|-
<p>PuTTY includes a utility called PuTTYgen to perform this function. This utility may be found in the PuTTY folder in the Windows Start menu (Figure 1).</p>
| <div><p>Figure 1</p></div>
<p>The procedure may be used to convert a previously created private key file (.PPK).</p>
|}
 
<p>PuTTY includes a utility called PuTTYgen to perform this function. This utility may be found in the PuTTY folder in the Windows Start menu (Figure 1).</p><p>The procedure may be used to convert a previously created private key file (.PPK).</p>
 
 
 
<br><br>
 
 
 
 
== Procedure ==
== Procedure ==
<p>After starting the PuTTYgen utility, load the private key (.PPK) file by clicking the “Load” button (Figure 2).<br><br></p><p>Figure 2</p><p>Once the file is loaded, select “Export OpenSSH Key” from the Conversions menu (Figure 3):</p><p><br></p><p>Figure 3</p>
[[image:img1738344171249.png|492px|left|frameless|Figure 2]]
{|
<p>After starting the PuTTYgen utility, load the private key (.PPK) file by clicking the “Load” button (Figure 2).</p>
|-
 
| <div><p>Figure 4</p></div>
 
|}
 
<p>If prompted to save the key without a passphrase, click “Yes” (Figure 4).</p><p>Once the file is saved, it is uploaded to the APU102. The BAT file on the APU102 used to send reports using SFTP need to be edited to specify the appropriate key file (see provided [[#Sample BAT File]]).</p><p><br></p><p><br></p><p>'''&nbsp;'''</p><p>'''&nbsp;'''</p>
 
 
 
 
 
<p><br><br>Once the file is loaded, select “Export OpenSSH Key” from the Conversions menu (Figure 3):</p>
[[image:img1738248864418.png|492px|left|frameless|Figure 3]][[image:img1738308929553.png|321px|left|frameless|Figure 4]]
<p><br><br><br></p>
<p><br><br><br>
<br><br><br></p>
<p>If prompted to save the key without a passphrase, click “Yes” (Figure 4).</p>
<p><br><br><br><br></p>
<p><br>Once the file is saved, it is uploaded to the APU102. The BAT file on the APU102 used to send reports using SFTP need to be edited to specify the appropriate key file (see provided [[#Sample BAT File|Sample BAT File]]).</p>
<p><br></p>
<p><strong>&nbsp;</strong></p>
<p><strong><br></strong></p>
<p><strong>&nbsp;</strong></p>
 


'''<br>'''<p>'''&nbsp;'''</p>
====== Open Source Licenses ======
====== Open Source Licenses ======
<p><br></p><p>CURL.EXE</p><p>COPYRIGHT AND PERMISSION NOTICE</p><p><br></p><p>Copyright (c) 1996 - 2010, Daniel Stenberg, &lt;daniel@haxx.se&gt;.</p><p><br></p><p>All rights reserved.</p><p><br></p><p>Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.</p><p><br></p><p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p><p><br></p><p>Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder.<br></p>
<p><br></p>
<p>CURL.EXE</p>
<p>COPYRIGHT AND PERMISSION NOTICE</p>
<p><br></p>
<p>Copyright (c) 1996 - 2010, Daniel Stenberg, &lt;daniel@haxx.se&gt;.</p>
<p><br></p>
<p>All rights reserved.</p>
<p><br></p>
<p>Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.</p>
<p><br></p>
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<p><br></p>
<p>Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder.<br></p>

Latest revision as of 15:49, 30 January 2025

SFTP (Secure File Transfer Protocol) feature is an optional module that provides encrypted consist and maintenance transport from the APU102 to a host system.

This document describes the installation and configuration of the SFTP client feature.

The described procedures are “generic”. Customer-specific procedures are described elsewhere.

Supported Hardware

The SFTP feature requires the LX800 processor module; the LPM-TX processor is not supported.

Contents

This document covers installation of the SFTP update and describes authentication (login) to an SFTP server.

See Also

To use public-private key authentication, see provided Sample BAT File.

Installation

The update payload is large so a fast and reliable link is required for installation.

Disclaimer

Comet Electronics makes no guarantees whatsoever regarding the suitability or security of any third-party software such as WinSCP, PuTTY, or TeraTerm. Use at your own risk.

It is up to the user to establish that software is genuine, properly licensed, and compliant with any company Information Technology (IT) policies.

Contact your IT department for guidance.


File Transfers Using ZMODEM over SSH

This note applies only if communications with the APU102 is by SSH. Plain Telnet connections are not affected.

In the current version of the SSH (Secure SHell) feature, ZMODEM transfer to send/receive file is not reliable.

As an alternative, SCP is supported (and is easier to use than ZMODEM). FTP may also be available (depending on APU102 settings).


Installation Details

Installation involves two steps: uploading the update payload (the three files noted earlier) and rebooting the APU102 to complete installation. The following shows step-by-step instructions for each of the supported upload methods.

Three files are sent to the APU102:

INSTSFTP.EXE
F.BAT
ZIP.PSP

Telnet

If Telnet connections are permitted, the ZREC command may be used to upload the update payload. (Note: ZMODEM over SSH is not reliable in the current software.)

  1. Connect to the APU102 using a Telnet client such as Tera Term.
  2. Login to Session #1 and use the C command to enter Change mode.
  3. For each of the three files, use the ZREC command and then send the file using ZMODEM transfer
  4. Reboot the APU102 (R command).
FTP

If the FTP server on the APU102 is enabled, an FTP client such as WinSCP or FileZilla may be used to send the update.

  1. Open an FTP session using the IP address for the APU102 being updated.
  2. Login using credentials provided by Comet.
  3. Navigate to the D:\AEI directory.
  4. Upload three update files.
  5. Close FTP session.
  6. Connect to the APU102 using a Telnet client or SSH client (if SSH is enabled).
  7. Login to Session #1 and use the C command to enter Change mode.
  8. Reboot the APU102 (R command).
SCP

If SSH is enabled, an SCP client such as WinSCP may be used to upload the update payload.

  1. Open an SCP session using the IP address for the APU102 being updated.
  2. Login using credentials provided by Comet.
  3. Navigate to the D:\AEI directory.
  4. Upload three update files.
  5. Close SCP session.
  6. Connect to the APU102 using a Telnet client or SSH client (if SSH is enabled).
  7. Login to Session #1 and use the C command to enter Change mode.
  8. Reboot the APU102 (R command).

Configuration

Configuration is customer specific. Consult Comet for guidance.

In general, configuration consists of installing appropriate access (ACC) files describe how the APU102 is to deliver consist and maintenance reports to a server. Parameters for report delivery are changed to specify the appropriate SFTP ACC files (AEIReportConnect and MaintReportConnect settings accessed using the EP command).

In the case of SFTP, the ACC file specifies that the APU executes a BAT (batch) file which consists of a list of Windows commands to prepare and deliver the report payload.

These BAT files are customized to meet each customer’s requirements. See Sample BAT File for an example.


Testing
  1. When the unit is running, connect again (don’t need Change mode at this point) and run the ST (Simulate Train) and SM (Simulate Maintenance event) to trigger reporting.
  2. Verify that the events are correctly reported to the railroad host system.

Procedure Complete.

Description of Changes

This update includes:

  • - Updated “curl.exe” package
  • - Updated report delivery scripts (ACC files). The names of these files are the same is in previous configurations. The new scripts refer to BAT files that contain the commands using curl.exe to send files using SFTP protocol.

Using WinSCP

WinSCP is available for download on the internet:

https://winscp.net/eng/index.php


Disclaimer

Comet Electronics makes no guarantees whatsoever regarding the suitability or security of any third-party software such as WinSCP, PuTTY, or TeraTerm. Use at your own risk.

It is up to the user to establish that software is genuine, properly licensed, and compliant with any company Information Technology (IT) policies.

Contact your IT department for guidance.


WinSCP provides a graphical interface showing files on your PC and files on the remote system. Refer to WinSCP website for documentation. When uploading files to the APU102, ensure that /d/aei is the current directory (see illustration).


To connect with an APU102, you will need to know which protocols are supported: SCP, FTP, or both. Note: is it possible for an APU102 to be configured such that neither transfer protocol is supported.

Authentication

When connecting to an SFTP server, the APU102 (the client) is required to provide a username and either a password or private key.

If a key is to be used, the private key is installed on the APU102 and specified in the BAT file.

The corresponding public key is installed on the server in the “authorized_keys” file. This is server-specific (e.g. OpenSSH configuration may not be the same as other server software).

Sample BAT File

A sample BAT file is shown:


REM 1 - site index

REM 2 - filename

REM 3 - site name


set OUTPUT=MYRR2CN.%1.TXT

set OUTPUT2=MYRR 2CN.2.%1.TXT

set OUTLOG=MYRR 2CN.%1.LOG


del %OUTPUT%

del %OUTPUT2%

del %OUTLOG%


REM be sure to keep the trailing '/' on the URL if specifying a directory!

curl -k -u someuser:somepassword -T %2 sftp://10.1.3.200/MYRR_TO_CNRR/ 1> %OUTPUT% 2> %OUTPUT2%


REM check error level

if NOT %ERRORLEVEL% == 0 goto Failure


REM create log file

:Success


echo Status:success > %OUTLOG%

echo Supporting info: >> %OUTLOG%

echo curl completed successfully >> %OUTLOG%


goto End


:Failure


:CurlFailure


echo Status:failure > %OUTLOG%

echo Supporting info: >> %OUTLOG%


strfunc -sf "curl:" %OUTPUT2%


if %ERRORLEVEL% == 1 goto UnknownFailure


strfunc -sf "curl:" %OUTPUT2% >> %OUTLOG%


goto End


:UnknownFailure


echo Status:failure > %OUTLOG%

echo Supporting info: >> %OUTLOG%

echo Curl had unexpected failure, check log file >> %OUTLOG%


:End


The name of the BAT file must agree with the name of the ACC file. In other words, if the ACC file is called AEICRR1.ACC, the corresponding BAT file must be called AEICRR1.BAT. By convention, the log files (specified in the three set statements at the top of the BAT file have the same base filename (e.g.  AEICRR1) as the ACC file.

If a key file is used in place of a password, the “curl” command should look like this:


curl -k –key keyfilename.key -T %2 sftp://username@10.1.3.200/MYRR_TO_CNRR/ 1> %OUTPUT% 2> %OUTPUT2%

Converting PuTTY Key to OpenSSH

If a public-private key pair is creating using PuTTY, the private key file must be converted to a format usable to OpenSSH before installing on the APU102.

Figure 1
Figure 1

PuTTY includes a utility called PuTTYgen to perform this function. This utility may be found in the PuTTY folder in the Windows Start menu (Figure 1).

The procedure may be used to convert a previously created private key file (.PPK).







Procedure

Figure 2
Figure 2

After starting the PuTTYgen utility, load the private key (.PPK) file by clicking the “Load” button (Figure 2).







Once the file is loaded, select “Export OpenSSH Key” from the Conversions menu (Figure 3):

Figure 3
Figure 3
Figure 4
Figure 4










If prompted to save the key without a passphrase, click “Yes” (Figure 4).






Once the file is saved, it is uploaded to the APU102. The BAT file on the APU102 used to send reports using SFTP need to be edited to specify the appropriate key file (see provided Sample BAT File).


 


 


Open Source Licenses


CURL.EXE

COPYRIGHT AND PERMISSION NOTICE


Copyright (c) 1996 - 2010, Daniel Stenberg, <daniel@haxx.se>.


All rights reserved.


Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.


THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder.