Created
April 19, 2017 14:00
-
-
Save jschappet/438a61582892a1c9d776601ec5c81c66 to your computer and use it in GitHub Desktop.
Jump Host Script for SecureCRT - Python Script
This file contains 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
# $language = "python" | |
# $interface = "1.0" | |
# Jump Host Script | |
# This script is intended to ssh from current host to | |
# host listed in the session name | |
# it uses the last portion of the Session Path as SSH Target | |
import SecureCRT | |
def main(): | |
objTab = crt.GetScriptTab() | |
objTab.Screen.Synchronous = True | |
strSessionPath = crt.Session.Path.replace("\\", "/") | |
#crt.Dialog.MessageBox("name: " + strSessionPath) | |
strSessionName = strSessionPath.split("/")[-1] | |
#crt.Dialog.MessageBox("name: " + strSessionName) | |
objTab.Screen.WaitForString(":~]$ ") | |
objTab.Screen.Send("ssh " + strSessionName + "\n") | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create new Session to your SSH Jump Host machine