SSH

Running sshd2 as a Started Task

To run sshd2 as a started task, use a JCL procedure such as SSHD2 (shown below) from /opt/tectia/doc/zOS/SAMPLIB. The JCL must be installed in the procedure library.

SSHD2:

//SSHD2   PROC F=START,OPTS='',PORT=22,WTORCS='1,11'
//TECTIA  EXEC PGM=BPXBATSL,
//             REGION=0M,
//             TIME=NOLIMIT,
//             PARM=('PGM /opt/tectia/etc/init.d/sshd2
//             &F foreground &WTORCS -p &PORT &OPTS')
//STDENV   DD  DSN=&SYSUID..SSZ.SRVR63.PARMLIB(SSHENV),
//             DISP=SHR
//STDOUT   DD  SYSOUT=*
//*STDERR   DD  SYSOUT=*
//STDIN    DD  DUMMY
//         PEND

Start the server with the following operator command:

== > s sshd2 

The sshd2 job starts.

As an OPTS parameter, you can give parameters that the actual binary accepts, such as -D 2. For example:

== > S SSHD2,OPTS='-D 2'

In the sample SSHD2 script above, sshd2 is started with the foreground option that disables the daemon mode. With the foreground option, the server does not spawn the process to background and the server task name stays as sshd2.

The sshd2 started task can also be started with a user-specified job name:

== > s SSHD2,jobname=own_job_name

You can assign the user SSHD2 to the started task by defining the procedure in the STARTED class and entering the user ID in the STDATA segment, for example:

RDEFINE STARTED SSHD2.* STDATA(USER(SSHD2)GROUP(SYS1))
SETROPTS RACLIST(STARTED) REFRESH 

For more information, see sshd2.