Introducing teleport helpers
This commit is contained in:
parent
f224a3c4b7
commit
2f4f2dbb66
6 changed files with 141 additions and 0 deletions
28
_src.posix/private_dot_local/bin/executable_tssh
Normal file
28
_src.posix/private_dot_local/bin/executable_tssh
Normal 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}"
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue