Environment variables
ssh typically sets or uses the
following environment variables:
- _ZOS_OPENSSH_DEBUG
- Contains z/OS-specific debug information. This environment variable is only used internally and is not for external specification.
- _ZOS_OPENSSH_DEBUG_TIMESTAMP
- If this variable is specified to YES, it will contain the timestamp in the debug information. If it is specified to CPU, the CPU time will be used as the timestamp.
- _ZOS_OPENSSH_MSGCAT
- Identifies the OpenSSH message catalog to be used when sending OpenSSH error messages.
- _ZOS_SMF_FD
- Set to the file descriptor number used for interprocess communication during SMF-related processing. This environment variable is only used internally and is not for external specification.
- _ZOS_USER_SSH_CONFIG
- Specifies the path name of the z/OS-specific per-user OpenSSH
client configuration file. The system-wide default is
/etc/ssh/zos_ssh_config
and the user's default is~/.ssh/zos_user_ssh_config
. If this variable is specified, it replaces the user's default file but not the system-wide default file. See zos_ssh_config and zos_user_ssh_config for the available keywords. The recommended permissions of the specified file are read/write for the user and not writable by others. - DISPLAY
- Indicates the location of the X11 server. It is automatically set by ssh to point to a value of the form hostname:n where hostname indicates the host where the shell runs, and n is an integer greater than or equal to 1. ssh uses this special value to forward X11 connections over the secure channel. The user should normally not set DISPLAY explicitly, as that will render the X11 connection insecure (and require the user to manually copy any required authorization cookies).
- HOME
- Set to the path for the user's home directory.
- LOGNAME
- Synonym for USER.
- Set to the path of the user's mailbox.
- PATH
- Set to the default PATH, as compiled into ssh.
- SSH_ASKPASS
- If ssh needs a passphrase, it reads
the passphrase from the current terminal if it was run from a terminal.
If ssh does not have a terminal associated
with it, but DISPLAY and SSH_ASKPASS are set, it executes the program
specified by SSH_ASKPASS and opens an X11 window to read the passphrase.
This is particularly useful when calling ssh from
an .Xsession or related script. It is necessary to redirect the input
from
/dev/null
to make this work. - SSH_AUTH_SOCK
- Identifies the path of a UNIX-domain socket used to communicate with the agent.
- SSH_CONNECTION
- Identifies the client and server ends of the connection. The variable contains four space-separated values: client ip-address, client port number, server ip-address and server port number.
- SSH_ORIGINAL_COMMAND
- Contains the original command line if a forced command is executed. It can be used to extract the original arguments.
- SSH_TTY
- Set to the name of the tty (path to the device) associated with the current shell or command. If the current session has no tty, this variable is not set.
- TZ
- Set to indicate the present time zone if it was set when the daemon was started (the daemon passes the value on to new connections).
- USER
- Set to the name of the user logging in.
~/.ssh/environment
and
adds lines of the format VARNAME=value to
the environment if the file exists and if users are allowed to change
their environment. For more information, see PermitUserEnvironment.