Secure (encrypted) FTP utility |
|||||||||||||||||||||||
|
Current version: A.06 We have a white paper (doc) (pdf) which describes how to increase FTP security by using the new features in FTP/iX. The encrypted FTP script (SFTPPUT) homed here is a piece of the security puzzle. SFTPPUT is available in a tarball, which also contains the POSIX crypt program (as an NM program file, NMPRG). The script is also downloadable as a plain text file. Crypt is also separately available here. SFTPPUT transfers one or more files from an MPE/iX system to a remote MPE, HP-UX, Linux, or Windows system. Typically the files are encrypted via the POSIX crypt utility. The remote system must support the same encryption algorithm in order to decrypt the file. More info can be found on crypt in the HP-UX man pages, or via the HP "docs" site at: docs.hp.com/en/B3921-90010/crypt. When the remote system is MPE/iX this script will attempt to automatically decrypt the file by streaming a job on the remote system via FTP's site stream command. SFTPPUT supports 7 parameters. The first parameter names the file to be transferred (wildcards supported), or is an indirect file (^filename). The second parameter is the name or IP address of the remote system. The first two parameters are required and the remaining 5 are optional. Online help text and a description of all of the parameters are displayed when the script is executed without any parameter values, e.g., :sftpput NETRC considerations:The SFTPPUT script is aware of the existence of the NETRC file. NETRC contains entries consisting of machine names and their corresponding user logon ID and passwords. FTP defers to the netrc logon information if it finds a matching machine name in the file. NETRC should be protected from non-privileged users since it contains passwords. A way to do this is to grant eXecute-only access to those users with a need to use it, and deny all other access to everyone else via the ALTSEC command. When NETRC is used, FTP/iX ignores user name and passwords, even when supplied via the 3rd parameter of this script. However, SFTPPUT may need to create a job which logs on to the remote system (in order to decrypt the file), and, in general, SFTPPUT will not have read access to NETRC. There are more detailed notes in the script, but when the NETRC FTP logon differs from the local user's username.account, it is recommended to specify the 'remoteUser' parameter (3rd parm).Debugging:If something goes wrong, or if you just want to see more details as the script executes, set the variable _SFTP_DEBUG to TRUE prior to invoking the script, e.g.::setvar _sftp_debug trueIn debug mode SFTPPUT displays additional information about each task it performs, and it preserves all of the intermediate TEMP files and all of the variables used by the script. Files that may be useful to examine are:
:listfile ./@;temp Decrypting on Unix:Here's a simple shell script to make it easier to decrypt files sent to a Unix system, assuming that system supports the POSIX crypt program. Thanks to donna -- the queen of MPE...Examples:
Instructions:
$tar xvf sfttput.tarAlternatively, from the CI you can enter: :xeq tar.hpbin.sys "xvf sftpput.tar"This extracts the SFTPPUT and CRYPT files, (please ignore the tar UID/GID messages), and they are ready to be renamed to the appropriate group on your 3000. CRYPT should be renamed into the HPBIN.SYS group, if possible. :rename ./sftpput.txt, SFTPPUTAlso, you'll get slightly better performance if the file is fixed ASCII, so the frombyte POSIX utility may need to be run. last updated: 2007-05-16 |