#!/usr/bin/env bash # shellcheck disable=SC2029 set -euo pipefail if (( $# != 2 )); then echo "usage: $(basename "$0") " 1>&2 exit 1 fi host=$1 command=$2 pass='xxxxxxxxxxx' # redacted sshpass -f ${pass} ssh -oStrictHostKeyChecking=no "${host}" "sudo -S -p '' ${command} < ${pass}"