Skip to content

Instantly share code, notes, and snippets.

@jschappet
Created April 19, 2017 14:00
Show Gist options
  • Save jschappet/438a61582892a1c9d776601ec5c81c66 to your computer and use it in GitHub Desktop.
Save jschappet/438a61582892a1c9d776601ec5c81c66 to your computer and use it in GitHub Desktop.
Jump Host Script for SecureCRT - Python Script
# $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()
@jschappet
Copy link
Author

Create new Session to your SSH Jump Host machine

  • Connection Name: target-host
  • SSH Hostname: jump-host
  • Save this file to your machine
  • In Logon Actions, check Login script
  • set the file location
  • Copy & Paste Session, then change name to connect to a different host

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment