Chapter 53: Controller: /nodeworx/siteworx Up Part II: NodeWorx API Spec Chapter 55: Controller: /nodeworx/ssl 

54 Controller: /nodeworx/sshd

Required Permissions "SSH"
Action: autoRestart
Added in version 4.7.0-339
Description Configure SSHD auto-restart.
Input Parameters
Name Type Notes Required?
sshd_autorestart integer Help Entry
With this option on, SSH will restart automatically if SSH goes down unexpectedly
Example Values
1, 0
Example Default Value
0
No*
cascade_to_nodes integer Help Entry
Selecting this option causes the action to be replayed on all nodes of the cluster automatically, as if you had logged in to each node manually
Example Values
1
No
* indicates that it’s actually required, but probably already has a valid default value
Action: isRunning
Added in version 4.7.0-339
Description Checks if the service is running or not.
Sample output
array (
’status’ => 0,
’payload’ => true,
)
Action: isRunningOnNode
Added in version 4.7.0-339
Description Checks if the service is running on a specific node (Clustering only).
Input Parameters
Name Type Notes Required?
node_id string No*
* indicates that it’s actually required, but probably already has a valid default value
Action: listGeneralName
Added in version 4.7.0-339
Description Lists the "normal" name - ie "web server" instead of "httpd".
Sample output
array (
’status’ => 0,
’payload’ => ’##LG_SSHSERVER##’,
)
Action: listPortNumbers
Added in version 4.7.0-339
Description Lists a string of the port numbers that this service uses, comma-seperated.
Sample output
array (
’status’ => 0,
’payload’ => ’22’,
)
Action: listPortNumbersArray
Added in version 4.7.0-339
Description Lists array of port numbers and ranges that this service uses.
Sample output
array (
’status’ => 0,
’payload’ =>
array (
0 => ’22’,
),
)
Action: listRequiredPermissions
Added in version 4.7.0-339
Description Lists an array of permissions required to control the service.
Sample output
array (
’status’ => 0,
’payload’ =>
array (
0 => ’SSH’,
),
)
Action: listServiceInfo
Added in version 4.7.0-339
Description Lists the service name, ports, page, and status.
Sample output
array (
’status’ => 0,
’payload’ =>
array (
’id’ => ’sshd’,
’name’ => ’##LG_SSHSERVER##’,
’ports’ => ’22’,
’page’ => ’/nodeworx/sshd’,
’ctrl’ => ’/nodeworx/sshd’,
’is_running’ => 1,
),
)
Action: listServiceName
Added in version 4.7.0-339
Description Lists the service name - ie "httpd" instead of "web server".
Sample output
array (
’status’ => 0,
’payload’ => ’sshd’,
)
Action: listServicePage
Added in version 4.7.0-339
Description Lists the page that controls the service.
Sample output
array (
’status’ => 0,
’payload’ => ’/nodeworx/sshd’,
)
Action: listSessions
Added in version 4.8.0-393
Description Lists information about current shell sessions.
Sample output
array (
’status’ => 0,
’payload’ =>
array (
),
)
Action: queryAutoRestart
Added in version 5.1.0-838
Description Displays the information available to the action "autoRestart".
Sample output
array (
’status’ => 0,
’payload’ =>
array (
’sshd_autorestart’ => ’0’,
),
)
Action: queryEditConf
Added in version 5.1.0-838
Description Displays the information available to the action "editConf".
Sample output
array (
’status’ => 0,
’payload’ =>
array (
’file’ => ’/etc/ssh/sshd_config’,
’file_content’ => ’# $OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 djm Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
# Disable legacy (protocol version 1) support in the server for new
# installations. In future the default will change to require explicit
# activation of protocol 1
Protocol 2
# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key
# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 1024
# Logging
# obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
SyslogFacility AUTHPRIV
#LogLevel INFO
# Authentication:
#LoginGraceTime 2m
#PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys
#AuthorizedKeysCommand none
#AuthorizedKeysCommandRunAs nobody
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don\’t trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don\’t read the user\’s ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no
PasswordAuthentication yes
# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes
ChallengeResponseAuthentication no
# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
#KerberosUseKuserok yes
# GSSAPI options
#GSSAPIAuthentication no
GSSAPIAuthentication yes
#GSSAPICleanupCredentials yes
GSSAPICleanupCredentials yes
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no
# Set this to \’yes\’ to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to \’no\’.
#UsePAM no
UsePAM yes
# Accept locale-related environment variables
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
AcceptEnv XMODIFIERS
#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#ShowPatchLevel no
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
# no default banner path
#Banner none
# override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server
# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# ForceCommand cvs server’,
),
)
Action: queryUpdateConfig
Added in version 5.1.0-838
Description Displays the information available to the action "updateConfig".
Sample output
array (
’status’ => 0,
’payload’ =>
array (
’port’ => ’22’,
’allow_root’ => ’yes’,
’sshd_login_timeout’ => ’120’,
’sshd_loglevel’ => ’info’,
’sshd_priv_separate’ => ’yes’,
),
)
Action: restart
Added in version 4.7.0-339
Description Restarts the service.
Input Parameters
Name Type Notes Required?
cascade_to_nodes integer Help Entry
Selecting this option causes the action to be replayed on all nodes of the cluster automatically, as if you had logged in to each node manually
Example Values
1
No
Action: restartOnNode
Added in version 4.7.0-339
Description Restarts the service on a specific node (Clustering only).
Input Parameters
Name Type Notes Required?
node_id string No*
* indicates that it’s actually required, but probably already has a valid default value
Action: start
Added in version 4.7.0-339
Description Starts the service.
Input Parameters
Name Type Notes Required?
cascade_to_nodes integer Help Entry
Selecting this option causes the action to be replayed on all nodes of the cluster automatically, as if you had logged in to each node manually
Example Values
1
No
Action: startOnBoot
Added in version 4.7.0-339
Description Configure SSHD start-on-boot.
Input Parameters
Name Type Notes Required?
sshd_startonboot integer Help Entry
If set to ’Yes’, SSH will be automatically started when the server starts up.
Example Values
1, 0
Example Default Value
1
No*
cascade_to_nodes integer Help Entry
Selecting this option causes the action to be replayed on all nodes of the cluster automatically, as if you had logged in to each node manually
Example Values
1
No
* indicates that it’s actually required, but probably already has a valid default value
Action: startOnNode
Added in version 4.7.0-339
Description Starts the service on a specific node (Clustering only).
Input Parameters
Name Type Notes Required?
node_id string No*
* indicates that it’s actually required, but probably already has a valid default value
Action: stop
Added in version 4.7.0-339
Description Stops the service.
Input Parameters
Name Type Notes Required?
cascade_to_nodes integer Help Entry
Selecting this option causes the action to be replayed on all nodes of the cluster automatically, as if you had logged in to each node manually
Example Values
1
No
Action: stopOnNode
Added in version 4.7.0-339
Description Stops the service on a specific node (Clustering only).
Input Parameters
Name Type Notes Required?
node_id string No*
* indicates that it’s actually required, but probably already has a valid default value
Action: terminate
Added in version 4.8.0-393
Description Terminate shell sessions.
Input Parameters
Name Type Notes Required?
pid struct (integer) Yes
Action: updateConfig
Added in version 4.7.0-339
Description Configure SSHD server settings.
Input Parameters
Name Type Notes Required?
port integer Example Default Value
22
No*
allow_root string Help Entry
Sets whether the root user can log in via ssh. Options are: <ul><li><b>Yes</b> - Root user is permitted to log in</li><li><b>Without Password</b> - Disables password authentication for the root user.</li><li><b>Forced Command Only</b> - Login is allowed but only if a command option was specified. Example: <pre>ssh root@test.com uptime</pre></li><li><b>No</b> - Root user is not permitted to log in.</li>
Example Values
yes, without-password, forced-commands-only, no
Example Default Value
yes
No*
sshd_login_timeout integer Help Entry
After this timeout period the server will disconnect a user who has not yet successfully logged in
Example Default Value
120
No*
sshd_loglevel string Help Entry
Sets the verbosity that is used when logging sshd messages
Example Values
quiet, fatal, error, info, verbose, debug1, debug2, debug3
Example Default Value
info
No*
sshd_priv_separate string Help Entry
Toggles privilege separation. Used to prevent privilege escalation during the authentication process.
Example Values
yes, no
Example Default Value
yes
No*
cascade_to_nodes integer Help Entry
Selecting this option causes the action to be replayed on all nodes of the cluster automatically, as if you had logged in to each node manually
Example Values
1
No
* indicates that it’s actually required, but probably already has a valid default value
Action: updateRrd
Added in version 4.7.0-339
Description Toggle SSHD rrd graph in web interface.
Input Parameters
Name Type Notes Required?
rrd integer Help Entry
Use the dropdown to turn the SSH server activity graph on or off.
Example Values
1, 0
Example Default Value
1
No*
* indicates that it’s actually required, but probably already has a valid default value
 Chapter 53: Controller: /nodeworx/siteworx Up Part II: NodeWorx API Spec Chapter 55: Controller: /nodeworx/ssl 

(C) 2017 by InterWorx LLC