...
Code Block |
---|
# Configuration
IP_ADDRESS=10.0.1.15 # IP address of the rack you want to login to
SSH_USER=myuser # user to use to remotely login to the rack
SSH_KEY=/home/myuser/.ssh/id_rsa # path to your SSH private key
# SSH Command
ssh -i $SSH_KEY -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $SSH_USER@$IP_ADDRESS |
...
Code Block |
---|
# Configuration
IP_ADDRESS=10.0.1.15 # IP address of the rack you want to login to
SSH_USER=myuser # user to use to remotely login to the rack
SSH_KEY=/home/myuser/.ssh/id_rsa # path to your SSH private key
JUMP_IP=54.1.1.1 # "publicly" accessible IP address of the jumpbox
JUMP_USER=myuser # user to use on the jumpbox
JUMP_KEY=/home/myuser/.ssh/id_rsa # key associated with the jumpbox user
# SSH Command
ssh -i $SSH_KEY \
-o UserKnownHostsFile=/dev/null \
-o StrictHostKeyChecking=no \
-o "ProxyCommand ssh -W %h:%p -i ${JUMP_KEY} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ${JUMP_USER}@${JUMP_IP}" \
$SSH_USER@$IP_ADDRESS |
...
Code Block |
---|
# Find compute rack by ip address rack = ComputeRack.find_by(private_ip_address: '10.0.1.15') # Perform SSH command rack.ssh("ls -al /tmp") rack.ssh("sudo docker ps") # SSH command with pretty output (console style) puts rack.ssh("ls -al /tmp")[:stdout] |