Introducing teleport helpers

This commit is contained in:
Lockszmith (@VAST) 2025-04-03 19:42:43 -04:00
parent f224a3c4b7
commit 2f4f2dbb66
6 changed files with 141 additions and 0 deletions

View file

@ -0,0 +1,28 @@
#! /usr/bin/env bash
set -e
SCRIPT_NAME="${0##/*}"
usage() {
printf '%s\n' \
'SSH using Teleport with interactive selection and VAST-reasnoble defaults' \
'' \
"${SCRIPT_NAME} " \
'' \
'Usage:' \
''
exit 2
}
if [[ $# -eq 0 ]]; then
usage
fi
SEARCH="$1"
SSHUSER="${SSHUSER:-vastdata}"
TUNNEL="${TUNNEL:+-L ${TUNNEL}}"
TARGET="${SSHUSER}@$(tsh-get "$SEARCH" "$SSHUSER")"
tsh ssh ${TUNNEL} "${TARGET}" "${@:2}"