SSH is Secure SHell. It allows you to securely logon to a remote Unix-like shell using OpenSSl.
SSH has little in common with SSL or TSH. For example you cannot keep “certificates” in z/OS keyrings. (The documentation says you can – but it is talking about something else).
SSH uses a different protocol and certificate to TLS – you cannot use TLS certificate for SSH encryption and authentication because they have different formats.
The IBM documentation for sshd starts here.
To connect to a server, the server needs to be running a daemon.
I’ve written a blog post on using a client to connect to SSH.
Setting up the SSH Daemon
The SSH daemon runs by default as started task SSHD. I changed the PARM in the JCL to be
//SSHD PROC //SSHD EXEC PGM=BPXBATCH,REGION=0M,TIME=NOLIMIT, // PARM='PGM /usr/sbin/sshd -f /etc/ssh/sshd_config ' //* PARM='PGM /bin/sh -c /etc/ssh/sshd.sh' //* STDIN AND STDOUT ARE BOTH DEFAULTED TO /dev/null //STDERR DD PATH='/tmp/sshd.stderr',PATHOPTS=(OWRONLY,OCREAT,OAPPEND), // PATHMODE=(SIRWXU) //STDOUT DD PATH='/tmp/sshd.stdout',PATHOPTS=(OWRONLY,OCREAT,OAPPEND), // PATHMODE=(SIRWXU)
The original PARM statement attaches the daemon as SSHD3. With my way, the started task is SSHD.
With the original PARM , the WLM classification came up as Workload SERVERS, SvrClass SRVOMVS, with my change the WLM classification was Workload STARTED, SvrClass STCLOM.
General setup
You can specify attributes that apply to all logons, and use theMatch statement to specify attributes which apply to a subset of logons. For example match on server userid, or match on client IP address.
Start the Daemon
S SSHD
Stop the Daemon
Either cancel SSHD, or cancel SSHD3, depending on how you started it.It may not responsd to the Stop command (P SSHD).
Basic configuration
You can display a logon message using
Banner /S0W1/var/log/banner.txt
You can specify a command that runs when they user logs on.
ForceCommand echo "HI ADCDA"
Listen address and port
You can specify
Port 22 Port 222 ListenAddress host ListenAddress host:port
How to authenticate
AuthenticationMethods publickey,password publickey,keyboardinteractive
Limit/allow userids or groups
AllowGroups sys1 DenyGroups OTHERS AllowUsers ADCDA ADCDB DenyUsers ADCDC ADCDC
Examples of match
If there are multiple Match statements, then the first applicable one is used.
Match user ADCDA
AuthenticationMethods publickey
Banner /S0W1/var/log/banner.txt
# ForceCommand echo "HI ADCDA"
Match Address 10.1.0.3
AuthenticationMethods publickey
Banner /S0W1/var/log/banner.txt
Match Address 10.1.0.2
AllowUsers IBMUSER
AuthenticationMethods password
Banner /S0W1/var/log/banner.txt2
# ForceCommand echo "HI 10.1.0.2 IBMUSER"
Debugging startup problems
The SSHD server writes to syslogd. Check the SYSLOGD daemon is active.
Look at the config file for
Problems
I got message
EZYFT16E accept error : EDC5122I Input/output error. (errno2=0x74687308)
The Unix command BPXMTEXT 74687308 gave
JrNoDuAvailable: TCP/IP cannot create a dispatchable unit to process the request. Either TCP/IP is not active or there is insufficient common storage available.
I think the error message means the port is in use, SSHD was unable to connect to the port. Check /S0W1/etc/ssh/ssh_config and find the port. It defaults to 22. Check to see if this is active
TSO NETSTAT allcon (port 22
One thought on “Configuring sshd server on z/OS”