To run SYSTEM/SSHCLIENT from CANDE, the value of the LAISSEZFILE option must be 6, so that the responses from the SSH commands can be returned to the CANDE session.
The value of the LAISSEZFILE option can be determined by entering the following command from a CANDE control station:
?LAISSEZFILE
To set the value of the LAISSEZFILE option, use the SECOPT CANDE LAISSEZFILE command of the CANDE ?LAISSEZFILE command. You must use the SECOPT CANDE LAISSEZFILE command when the security class is S0, S1, or S2. Use the following commands:
?LAISSEZFILE 6
or
SECOPT CANDE LAISSEZFILE
Note: | You must enter the ?LAISSEZFILE command from a CANDE control station. For more information, refer to the CANDE Configuration Reference Manual. |
Using SYSTEM/SSHCLIENT/ADMIN to Enable the Client
The SYSTEM/SSHCLIENT/ADMIN program is used to enable and disable the SSHCLIENT library. Always run the SYSTEM/SSHCLIENT/ADMIN from a privileged usercode. The following parameters are supported:
Parameter |
Description |
ENABLE |
Initiates the SSHCLIENTSUPPORT library, allowing the SSHCLIENT to issue SSH commands. |
DISABLE (and DISABLE NOW) |
Terminates the SSHCLIENTSUPPORT library. If NOW is used, commands in process are terminated. |
LOG <level> |
Sets the logging level. See Diagnostic Log Levels Supported by SSHCLIENT for more information. |
Creating an SSHCLIENT Configuration File (Optional)
The SYSTEM/SSHCLIENT program initializes using specified default values for certain global attributes. These global attributes and their default values are also contained in the *SYSTEM/SSHCLIENT/DEFAULTCONFIG file. If the default values are not suitable, they can be modified by creating the *SYSTEM/SSHCLIENT/CONFIG file that contains the desired values.
To create the *SYSTEM/SSHCLIENT/CONFIG file
-
Copy *SYSTEM/SSHCLIENT/DEFAULTCONFIG as *SYSTEM/SSHCLIENT/CONFIG.
-
Modify the desired attributes values in *SYSTEM/SSHCLIENT/CONFIG.
If the *SYSTEM/SSHCLIENT/CONFIG file is available when SYSTEM/SSHCLIENT is started the first time, then SYSTEM/SSHCLIENT initializes using the values contained in *SYSTEM/SSHCLIENT/CONFIG. If the *SYSTEM/SSHCLIENT/CONFIG file is not available when SYSTEM/SSHCLIENT is started the first time, then SYSTEM/SSHCLIENT initializes using the specified default values.
Running SSHCLIENT
You can now run the SYSTEM/SSHCLIENT program. For example:
R *SYSTEM/SSHCLIENT ("SSH -l bob -P password -p 22 10.0.0.1 uname")
The first time you run SYSTEM/SSHCLIENT or SYSTEM/SSHCLIENT/ADMIN, the following occurs:
-
A shared client support library called SYSTEM/SSHCLIENT/SUPPORT is started and remains running until you terminate it.
-
A shared set of request files called SYSTEM/ SSHCLIENT/REQUEST and SYSTEM/ SSHCLIENT/REQUEST/= are created, and they remain until removed. If the SSHCLIENT request files are not removed, the SSHCLIENT/SUPPORT library links to the existing SSHCLIENT request files, resulting in possible retries of previously failed SSH commands. In either case, the SSHCLIENT requests files remain until you remove them.
Example 1
#1186 SSHCLIENTSUPPORT:SYSTEM/SSHCLIENT/REQUEST file is not present. A new file will be created. #1186 DISPLAY:**WARNING** FILE NOT CLOSED *SYSTEM/SSHCLIENT/REQUEST ON DISK. #1186 PK500 REMOVED *SYSTEM/SSHCLIENT/REQUEST/AUDIT1 ON DISK #1187\1189 BOT (ADMINISTRATOR)SYSTEM/SSHCLIENT/MANAGER ON DISK #1187\1190 BOT *SYSTEM/SSHCLIENT/SUPPORT #1187\1191 BOT (ADMINISTRATOR)SYSTEM/SSH/CLIENT2 ON DISK Linux #1187\1191 EOT (ADMINISTRATOR) (ADMINISTRATOR)SYSTEM/SSH/CLIENT2 ON DISK #ET=5.9 PT=0.5 IO=0.1
Subsequent instantiations of SYSTEM/ SSHCLIENT utilize the currently running SYSTEM/SSHCLIENT/SUPPORT library and the existing SYSTEM/ SSHCLIENT/REQUEST files.
Example 2
R *SYSTEM/SSHCLIENT ("SSH -l bob -P password -p 22 10.0.0.1 uname") #RUNNING 1192 #? #1187\1193 BOT (ADMINISTRATOR)SYSTEM/SSH/CLIENT2 ON DISK Linux #1187\1193 EOT (ADMINISTRATOR) (ADMINISTRATOR)SYSTEM/SSH/CLIENT2 ON DISK #ET=3.7 PT=0.0 IO=0.0
If you are running the SYSTEM/ SSHCLIENT program from CANDE, use the RO MSG command to hide normal and unnecessary displays. In this mode, the SSH command and responses appear on your CANDE screen.
Example 3
R *SYSTEM/SSHCLIENT ("SSH -l bob -P password -p 22 10.0.0.1 uname") #RUNNING 1194 #? Linux #ET=2.5 PT=0.0 IO=0.0
When you want to view additional displays on your CANDE screen, use the SO MSG command from your CANDE session.