SSH

File Transfer Environment Variables for the Server

The environment variables for file transfer on Tectia Server for IBM z/OS can be set in the /etc/environment file globally for all users and in the $HOME/.ssh2/environment file for each user separately.

File transfer server uses the following environment variables:

SSH_SFTP_HOME_MVS                       (default: "no")
SSH_SFTP_RECORD_TRUNCATE                (default: "no")
SSH_SFTP_STAGEFS_CACHE_SIZE_LIMIT       (default: "524288000")
SSH_SFTP_STAGEFS_CACHE_ENTRY_LIFETIME   (default: "10")
SSH_SFTP_STAGEFS_CACHE_REFRESH_INTERVAL (default: "5")
SSH_SFTP_DEBUG                          (default: NULL)
SSH_SFTP_DEBUG_FILE                     (default: NULL)
SSH_SFT_PSEUDOVOLUME_VOLSERS            (default: MIGRAT)
SSH_SFTP_VOL_UNIT_MAP                   (default: NULL)

If SSH_SFTP_HOME_MVS is set to yes, the file transfer server starts in the MVS side. The file transfer client sees USER prefix as its starting directory. Default is no, the file transfer server starts in the USS side. See Setting the File Transfer Home Location for examples of using this variable.

The SSH_SFTP_RECORD_TRUNCATE environment variable can be used to set the default value for the record_truncate file transfer attribute. The valid values are yes and no. The environment variable will be overridden by a matched transfer profile or the advice string if they contain the record_truncate (or U) attribute. If none of these sources is available, no will be used.

The SSH_SFTP_STAGEFS_CACHE_SIZE_LIMIT variable specifies staging cache size in bytes. It limits the use of system resources. The default is 524288000 bytes (500 MB).

The SSH_SFTP_STAGEFS_CACHE_ENTRY_LIFETIME variable specifies how many seconds one cache entry is stored in the cache. After the lifetime has expired the entry is removed from the cache and system resources are released. The default is 10 seconds.

The SSH_SFTP_STAGEFS_CACHE_REFRESH_INTERVAL variable specifies how many seconds may pass until the cache is refreshed. The default is 5 seconds.

With SSH_SFTP_DEBUG, the debug level can be set for the file transfer server.

If SSH_SFTP_DEBUG_FILE is set, debug messages are stored in the file named in the variable.

The SSH_SFT_PSEUDOVOLUME_VOLSERS can be used to define a list of pseudo-volume serial numbers for data sets that are migrated or archived, see Restoring Archived Data Sets.

The environment variable SSH_SFTP_VOL_UNIT_MAP can be defined to provide a mapping between a volume serial number pattern and a device unit, allowing the unit to be deduced from the volume. See SFTP and Tape Data Sets for more details.

Setting the File Transfer Home Location

For SFTP connections, the file transfer home location is the directory on the server where the SFTP session starts. For SCP operations, the home location is the default target of the operation on the server, and directory paths are relative to the home location.

By default, Tectia Server for IBM z/OS uses the user's Unix System Services (USS) home directory as the file transfer home location.

The environment variable SSH_SFTP_HOME_MVS in the user's $HOME/.ssh2/environment file on the server can be used to control the file transfer home location.

If the environment variable is omitted or its value is no, the user's USS home directory is used as the file transfer home, for example /u/userid/, and the MVS user prefix must be accessed using "//" or "/_".

If the value of the environment variable is yes, the user's MVS USERID prefix is used as the file transfer home location, for example //'USERID., and the USS home directory must be accessed using /u/userid/ or ~.

Examples when SSH_SFTP_HOME_MVS=no

When SSH_SFTP_HOME_MVS is set to no (or omitted), the following put command run in the Windows SFTP client results in a file /home/user1/dataset.txt in Tectia Server for IBM z/OS:

sftp> open user1@zos
sftp> put dataset.txt

Also the following Windows SCP client command would result in the same data set:

$ scpg3 --dst-site="X=TEXT" file.txt user1@zos:dataset.txt

The following sput command run in the Windows SFTP client results in a MVS sequential data set //'USERID.MF.FILE' in Tectia Server for IBM z/OS:

sftp> open user1@zos
sftp> sput remote_file //MF.FILE

The same applies to the Windows SCP client command.

Examples when SSH_SFTP_HOME_MVS=yes

When SSH_SFTP_HOME_MVS is set to yes, the following put command in a Windows SFTP client results in a data set //'USER1.DATASET.TXT' in Tectia Server for IBM z/OS:

sftp> open user1@zos
sftp> put dataset.txt

Also the following Windows SCP client command would result in the same data set:

$ scpg3 --dst-site="X=TEXT" file.txt user1@zos:dataset.txt

The following sput command run in the Windows SFTP client results in a USS file /u/user1/mf.file in Tectia Server for IBM z/OS:

sftp> open user1@zos
sftp> sput remote_file ~/mf.file

Or:

sftp> open user1@zos
sftp> sput remote_file /u/user1/mf.file

The same applies to the Windows SCP client command.