Last active
January 5, 2017 00:23
-
-
Save miticojo/d45bc3fedf8bd7d5ea33ce83c6567cdb to your computer and use it in GitHub Desktop.
SSH jump through solaris bastion host
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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