UNIX - Integrating UDM with FTP Using a Command Reference

UNIX - Integrating UDM with FTP Using a Command Reference

This example demonstrates the use of Command Reference files. Command References provides a very secure environment in which to store and from which to execute commands and scripts for use with UCMD Manager.

Note

This example is based on the example in UNIX - Integrating UDM with FTP Using a Shell Script. Understanding that example is a prerequisite to using this one. Also, the test environment in the previous example is the same as in this example.

If you are not familiar with Command References, please read Command References.

UDM Script Explanation

Other than Line 8, this UDM script is identical to the previous example. The exec command in line 8 uses the UCMD server running on the local system to execute the shell script contained in the Command Reference file ftp.cref. One option, the remote system name, is passed to the script via the Command Reference.

Command Reference files must reside in the directory specified by the CMD_REFERENCE_DIRECTORY UCMD Server configuration option. On UNIX systems this directory defaults to /var/opt/universal/cmdref.


1. set echo=yes
2. open rmt=192.168.20.47 user=joe pwd=abcdefg port=7887
3. mode type=text
4. attrib local createop=replace
5. cd rmt=C:\tmp\tmp
6. cd local=/home/joe/wrk/xmp/dmzFtp
7. copy rmt=file.txt.org local=file.txt
8. exec local cmdref="ftp.cref houston" user=joe pwd=abcdefg port=7887
9. exec houston cmd="ls /home/joe/tmp" user=joe pwd=abcdefg port=7887
10. quit


The ftp.cref Command Reference file contains the shell script used to FTP the file to the remote system behind the firewall. The allow_options option is changed to yes to allow the server address to be passed to the script. By default, no options are passed.

The format option is changed from cmd to script; otherwise, the script will not be generated.

UDM exec Command Parameters

The exec command parameters used in this example are:

Parameter

Description

cmdref

Command Reference file name and, optionally, options to be passed to the command or script.

user

Remote user ID with which to authenticate and execute the command on the remote system.

pwd

Password with which to authenticate the user ID on the remote system.

port

Port that the Universal Broker is listening on for the remote machine. The port is inherited from the UDM Manager's configuration file unless explicitly overridden in the call to the exec command.