XHE: Making WinSCP work in command line mode with XHE

XHE: Making WinSCP work in command line mode with XHE

1. Download and install WinSCP from https://winscp.net/eng/download.php
 
2. Start a listener process on an available NonStop port
 
    a. run $<vol>.xygatehe.xhe install 
    b. xhe_start_listner <port #> -a:ftp -ssl_neg:ftp-auth
 
    Where $<vol> is the disk volume where XHE is installed
                  <port #> is the desired port number
 
  Note: This is a standalone port.  If for some reason the listener process goes away, there will be no
             automatic restart and you will need to run XHE_START_LISTNER for this port again.  Add an entry
             in the PORTCONF for a permanent solution.  Please see section 3.4.1.1 Add Entries to the
             PORTCONF file in the XHE manual for more details.
 
3. Start the WinSCP GUI.  This can be used to generate a script template, which can then be run at a
    command line.  Make the following selections at the Logon window:

 




Make the following selections:
 
File protocol  - Select FTP
Encryption     - Select TLS/SSL Explicit encryption
Host name     - Enter the host domain name or ip address
Port number  - Enter the port number where you started the listner process
User name     - Enter the user name that will logon to the NonStop host
Password       - Enter the password for the above




Once logged in, select Session/Generate Session/URL Code from the pulldown menu at the top of the display:




You may disconnect the session and exit the WinSCP GUI.

5. In the Generate session URL/Code screen, click on the Script tab, then change the format to Script
    File.  Once those changes are made, then click Copy to Clipboard. This  action will generate the
    template for a script that can be run at the command line.
 
 
6.  Open Notepad and paste the information from the clipboard.  It should paste as a script similar to the
      following:
 

open ftpes://<user id>:<password>@<domain name>:<port>/ -certificate="xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
 
# Your FTP command 1
# Your FTP command 2

 
exit
 
# Execute the script using a command like:
# "C:\Program Files (x86)\WinSCP\WinSCP.exe" /log="C:\writable\path\to\log\WinSCP.log" /ini=nul /script="C:\path\to\script\script.txt"
 
In reality, your script will be automatically populated with the NonStop user id, password, domain name or ip address, port number and certificate fingerprint information.  You will need to manually populate the ?Your FTP command? lines with the desired FTP command(s) that you want to execute.
At the bottom of the script where it shows WinSCP.exe, this can be changed to WinSCP.com.
 
On completion of editing your script, save it to the desired location on your hard drive.
 
 
7. Barring any further changes, your script is ready to execute and can be invoked  at a command line.    The script can be executed from a DOS command line similar to the following:




Please note that WinSCP may be installed in a directory other than what is shown in the sample DOS prompt above.  Likewise, the script file may be located in a different directory than what is shown in the example.




If this article did not provide a solution, please open a case with our support team by sending an email message to support@xypro.com.




































    • Related Articles

    • XHE: Secure ODBC using XHE

      XYCONF on 192.160.10.20 # MX/ODBC/XHE TEST FOR INTERNAL IP STACK 18649 $SYSTEM.XYGATEHE.XYGATEHE -A:ODBC -T:$ZTCMX -SSL_NEG:SSLSRV -P:18650 #18650 RESERVED FOR ODBC/MX 18651 $SYSTEM.XYGATEHE.XYGATEHE-A:ODBC -T:$ZTCMX -SSL_NEG:SSLSRV -P:18651 18652 ...
    • XHE: How to create a Monitor Dump.

      To create a XYGATEHE monitor dump: In the HECONF file, remove the comment from the following line: !MONITOR $S.#XHE.MONITOR Execute the XHE_COMPILE macro by typing the following: RUN XHE_COMPILE Reproduce the reported issue. Back out changes made in ...
    • XUA: How do I disable Multi-Factor Authentication (MFA) for FTP command line sessions?

      FTPSERV does not support MFA for FTP interactive sessions. To configure XUA to disable MFA for interactive sessions, add a UAGROUP with the appropriate FTP requestor (FTPSERV or XHESERV) above the MFA UAGROUP in the UAACL file. Example: UAGROUP ...
    • XAC: The COMMAND-STATUS field can extract the rejected XAC command executions from the AUDIT file

      Step 1. Add the ' AND COMMAND-STATUS <> "" ' after the ' audit-type = "XAC-C" ' line in the REPSAMP file. < before adding > where audit-type = "XAC-C" < after adding > where audit-type = "XAC-C" AND COMMAND-STATUS <> "" Step 2. Execute an ASSIGN ...
    • XAC: OBEY within a TACL macro does not work as expected in XAC TACL

      An obey command executed from the TACL prompt will be captured and controlled if the ACACL entry has ALIAS entries for OBEY. An obey command within a TACL macro will not be captured or controlled. There are constructs in obey files that if obeyed ...