Skip to main content

Bastion Server | ssh cli

Hoop could act as a bastion server and connect into ssh hosts to allow execution of one-off sessions.

Connection Configuration

NameTypeDescription
SSH_PRIVATE_KEYfilesystemThe SSH key to connect into servers
SSH_URIenv-varThe URI to connect to the server, e.g.: ssh://[user@]hostname[:port]

Connection Command

ssh $SSH_URI -i $SSH_PRIVATE_KEY

How to Use

Start an interactive session with ssh remote server

# bash interactive session
hoop connect node01
# python3 interactive session
hoop connect node01 -- -t python3

In the same connection, one-off process can be run as well

hoop exec node01 -- python3 <<EOF
import os
print(os.environ)
EOF

hoop exec node01 -i 'import os; print(os.environ)' -- python3
hoop exec node01 -- 'uname -a'