securecrt python脚本使用特殊端口打开ssh

securecrt python脚本使用特殊端口打开ssh,python,ssh,port,Python,Ssh,Port,如何使用python脚本创建带有特殊ssh端口的选项卡, 像这样: # $language = "python" # $interface = "1.0" host = '192.168.1.1' user = 'test' passwd = 'test' def main(): # how to use the port 22333 for ssh cmd = "/SSH2 /PASSWORD %s %s@%s port=22567" % (passwd, user, hos

如何使用python脚本创建带有特殊ssh端口的选项卡, 像这样:

# $language = "python"
# $interface = "1.0"
host = '192.168.1.1'
user = 'test'
passwd = 'test'

def main():
    # how to use the port 22333 for ssh
    cmd = "/SSH2 /PASSWORD %s %s@%s port=22567" % (passwd, user, host)
    crt.Session.ConnectInTab(cmd, True)

main()
这不起作用,但在默认端口22的情况下,它起作用:

cmd = "/SSH2 /PASSWORD %s %s@%s" % (passwd, user, host)
感谢您将cmd更新如下:

cmd = "/SSH2 /PASSWORD %s %s@%s /P 22567" % (passwd, user, host)


参考资料:

第一个例子是工作!参考:
cmd = "/SSH2 /PASSWORD %s %s@%s -p 22567" % (passwd, user, host)