piramiko异常:SSH session not active,求大神解答

单蛙 发布于 2016/06/27 11:54
阅读 1K+
收藏 0
deploySHPath = os.path.join(BASE_DIR,"static","constantfiles","jenkins-java-conf.sh")
rollbackSHPath = os.path.join(BASE_DIR,"static","constantfiles","jenkins-java-conf-backup.sh")
list_fail = []
t=paramiko.Transport((ip,SSH_PORT))
key=paramiko.RSAKey.from_private_key_file(PKEY)
sftp=paramiko.SFTPClient.from_transport(t)
sftp.put(deploySHPath,"/tmp/jenkins-java-conf.sh")
sftp.put(rollbackSHPath,"/tmp/jenkins-java-conf-backup.sh")
sftp.put(confPath,"/tmp/%s" % conf_name)
t.close()

#paramiko.SFTPClient.from_transport(t)这行抛出异常,异常信息为:
#SSH session not active
#求大神帮忙解答



加载中
0
单蛙
单蛙

脑子进水了,少写一行....

key=paramiko.RSAKey.from_private_key_file(PKEY)
t=paramiko.Transport((ip,SSH_PORT))
t.connect(username=SSH_HOST_NAME, pkey=key)
sftp=paramiko.SFTPClient.from_transport(t)

返回顶部
顶部