Skip to content

Instantly share code, notes, and snippets.

@miticojo
Last active January 5, 2017 00:23
Show Gist options
  • Save miticojo/d45bc3fedf8bd7d5ea33ce83c6567cdb to your computer and use it in GitHub Desktop.
Save miticojo/d45bc3fedf8bd7d5ea33ce83c6567cdb to your computer and use it in GitHub Desktop.
SSH jump through solaris bastion host
Host target
ProxyCommand ssh bastionhost.local "/bin/bash -c 'exec 3<>/dev/tcp/%h/%p; cat <&3 & cat >&3;kill $!'"
Host bastionhost.local
User root
ControlPath ~/.ssh/bastion-%r@%h:%p
ControlPersist 5m
export ssh_user="user"
export ssh_pass="passw"
jump_ssh(){
sshpass -p$ssh_pass ssh -p 22 -l $ssh_user -A -t bastionhost.local /usr/local/bin/sudo ssh -A -t "${@:1}"
}
# add it in .bashrc or where you need
# connect through ssh server running "jump_ssh <remote-ip-or-host-behind-bastion>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment