NAME
sshpass - run ssh non-interactively by supplying its password
SYNOPSIS
/opt/omnicube/bin/sshpass [-f filename | -d number | -p password | -e] [-P prompt] [-v] command [parameters...]
sshpass [-h] [-V]
DESCRIPTION
sshpass is a third-party utility, bundled unmodified with OmniCube, that runs another program (in practice ssh(1) or scp(1)) in its own pseudo-terminal and types a password into it when the program asks for one. It exists because ssh(1) deliberately reads its password from the terminal rather than from standard input, which makes it impossible to drive from a script without a helper.
The version shipped here is sshpass 1.06, built for illumos. It is not part of the OmniCube code base and is not maintained by the OmniCube authors.
Within the suite it is used only for remote work that cannot be done with public-key authentication, typically talking to a peer or an appliance where an OmniCube key has not been (or cannot be) installed in authorized_keys. Everything that runs between cluster nodes uses key-based, non-interactive ssh instead, with the shared options set in /opt/omnicube/lib/common/utils.sh (BatchMode=yes, StrictHostKeyChecking=yes).
The password is taken from exactly one source, selected by -f, -d, -p or -e; with none of them given, it is read from standard input. Combining two sources is an error ("Conflicting password source"). sshpass then executes command with its parameters, watches the child's terminal output for the password prompt, and writes the password followed by a newline when it sees it. If the prompt appears a second time the password was wrong, and the child is terminated. If the child asks to confirm an unknown host key instead, that is reported as a host authentication prompt and sshpass exits without confirming the key.
It lives in /opt/omnicube/bin rather than in /usr/bin, so the suite carries its own copy and does not depend on the host having sshpass installed, and so an OmniCube upgrade cannot be broken by, or break, a platform package. Invoke it by absolute path (or make sure /opt/omnicube/bin precedes /usr/bin in PATH) when you need the bundled build.
OPTIONS
OPERANDS
EXAMPLES
Example 1: Password from a protected file
$ chmod 600 /var/opt/omnicube/.appliance.pw
$ /opt/omnicube/bin/sshpass -f /var/opt/omnicube/.appliance.pw \\
ssh -o BatchMode=no admin@appliance 'show version'
Example 2: Password from the environment
$ read -s SSHPASS; export SSHPASS $ /opt/omnicube/bin/sshpass -e scp report.txt admin@appliance:/tmp/
Example 3: A non-standard prompt
$ /opt/omnicube/bin/sshpass -f /root/.pw -P 'Enter passcode:' \\
ssh admin@appliance 'reload'
Example 4: Password on a file descriptor
$ /opt/omnicube/bin/sshpass -d 3 ssh admin@appliance 'uptime' \\
3< /var/opt/omnicube/.appliance.pw
EXIT STATUS
FILES
ENVIRONMENT
SECURITY
Do not use -p. A command's arguments are visible to every user on the host through the process table (ps -eaf, pargs(1)), so -p secret publishes the password for as long as the command runs, and typically also records it in the invoking shell's history file and in any script that contains it. Prefer, in order:
Whichever source is used, remember that sshpass answers the password prompt automatically, so it also defeats the protection an interactive prompt gives against a man-in-the-middle: pair it with a pre-populated known_hosts and never with StrictHostKeyChecking=no. Exit status 6 and 7 exist precisely so a script can tell an unknown or changed host key from a bad password. Store credentials only under root-owned directories, never in a file that is group or world writable.
SEE ALSO
activate_zone_vnc.sh(1), generate_mac_address_vm(1), oc_ssh(3), omnicube_utils(3), sync_pool.sh(8), manage_zone.sh(8), omnicube(7).
NOTES
sshpass is upstream software; report defects in it upstream, not to the OmniCube maintainers. Only its presence in /opt/omnicube/bin and the guidance above are OmniCube policy.
Because the child runs under a pseudo-terminal created by sshpass, the child's standard input is not a terminal from the caller's point of view. Interactive programs invoked through it behave slightly differently than when run directly, and a program that needs a controlling terminal for something other than the password prompt may misbehave.
A prompt is detected by matching a substring of the child's output; the default match is deliberately short ("assword") so it works for both "Password:" and "password:". Output from the remote command that happens to contain that substring can be mistaken for a prompt, in which case use -P with a longer, more specific string.
No OmniCube script calls sshpass today. It is shipped for operator use and for site-local scripts; the suite's own remote operations require key authentication and fail fast rather than prompt, because BatchMode=yes is set.