![]() | Important |
|---|---|
Before proceeding, ensure that the Co:Z Toolkit for z/OS has been successfully installed according to the instructions provided in the document "Co:Z Toolkit Installation and Release Notes" at http://www.dovetail.com/docs/cozinstall/index.html. Be sure to make note of the installation directory. You do not need to install the Co:Z Target System Toolkit on your remote systems to use Co:Z SFTP - a compatible SSH/SFTP product is all that is required. |
The configuration discussed here is designed to allow individual users to use either the original sftp-server or the enhanced Co:Z version, depending on their configuration. The default setup makes for an ideal beta testing environment, as only designated users will use the enhanced Co:Z sftp-server.
Update the
sshd_configfile, typically located at/etc/ssh/sshd_configto modify the sftp subsystem definition: [2]#Subsystem sftp /usr/lib/ssh/sftp-server
Subsystem sftp /usr/lpp/coz/bin/sftp-server.sh
The original sftp subsystem line should be commented out.
The new subsystem line should point to the
sftp-server.shshell script located in the Co:Z installationbindirectory. This script is designed to run the original sftp-server by default, but will run the Co:Z version if the user has configured it. See the section called “Customizingsftp-server.rc” for details. The installation process should have marked this file as executable, but this should be verified.If OpenSSH sshd was running prior to editing
sshd_config, it should be reinitialized. This can be done by sendingSIGHUPto the running process. The pid for this process is typically in the file/var/run/sshd.pid:kill -HUP `cat /var/run/sshd.pid`
By default, the sftp-server.sh script discussed above will execute the IBM version of
sftp-server. Individual users can activate the Co:Z version of stfp-server by
copying a special profile shell to their home .ssh directory:
# if the user's .ssh does not exist: mkdir $HOME/.ssh chmod 700 $HOME/.ssh cp /usr/lpp/coz/samples/sftp-server.rc $HOME/.ssh chmod u+x $HOME/.ssh/sftp-server.rc
Note: Removing or renaming this file will re-enable the IBM version of sftp-server.
In order to make the Co:Z sftp-server the default for all
users, place a copy of sftp-server.rc in /etc/ssh:
cp /usr/lpp/coz/samples/sftp-server.rc /etc/ssh chmod +x /etc/ssh/sftp-server.rc
In this version of the profile, explicitly set the environment variable
USE_COZ_SFTP:
USE_COZ_SFTP=true
Some installations prefer to restrict ssh users to a certain set of commands like the sftp-server, rather than giving them interactive shell access. See Appendix G, Restricting OpenSSH users to SFTP for a technique to enforce this restriction.
A sample version of sftp-server.rc can be found in the samples directory
of the installed Co:Z Toolkit. This file can be used as a template for individual users to modify and place in their
$HOME/.ssh directory.
#! /bin/sh # The presence of this executable script in $HOME/.ssh/sftp-server.rc # will cause the COZ version of sftp-server to be used # You may uncomment and set the following options to override the defaults: #export SFTP_ZOS_OPTIONS="mode=text"#export SFTP_ZOS_INITIAL_DIR=//
#export SFTP_LOGFILE=$HOME/sftp.log
# The Co:Z support team may request that you uncomment the following options # to enable tracing: #export SFTP_SERVER_OPTIONS="-e -l debug3" #export COZ_LOG=T
| The |
| The |
| Logfiles are created for every sftp server session; these files are of particular interest in case a
problem is encountered and additional error detail is needed. By default, logfiles are written to
the /tmp directory (or the directory specified by the |
When the cozsftp command is invoked, the contents of the files
/etc/ssh/cozsftp_client.rc and $HOME/.ssh/cozsftp_client.rc
are dotted into the environment at the start of the command.
These files may be used to automatically provide command line arguments to the cozsftp client
without having to explicitly code them every time the client is invoked. The desired command line
arguments should be made available in the environment variable COZSFTP_CLIENT_OPTS.
For example, assume that the file /etc/ssh/cozsftp_client.rc is created
with the following content:
#!/bin/sh COZSFTP_CLIENT_OPTS="-S /u/vendor/oshxl/bin/ssh"
In this example, the -S option directs all invocations of cozsftp
to use the OpenSSH Accelerator for
its ssh program.
[2] It is sometimes convenient to set up a test OpenSSH server where this subsystem can be easily modified. To do this see: Appendix H, Setting up a test OpenSSH system on z/OS.
![[Important]](images/important.gif)
