今天遇见一个以前没遇见的问题,用了自己写的remote_run_everything的库sftp上传文件,库地址:[https://github.com/wangmarkqi/remote_run_everything]。由于ssh登陆参数是管理员给的,按照这个参数,xshell是可以登陆的,但是自己写的库接不上,始终报错,定位在paramiko:
if not self.is_authenticated():
e = self.transport.get_exception()
if e is None:
e = AuthenticationException("Authentication failed.")
# this is horrible. Python Exception isn't yet descended from
# object, so type(e) won't work. :(
if issubclass(e.__class__, PartialAuthentication):
return e.allowed_types
raise e
后来发现直接win下用ssh居然无密码就上去了(这是测试服务器),然后在remote_run_everything库中把密码也写成None,居然就好了,特此记录,以后研究下怎么回事。
博主遇到使用自编写的remote_run_everything库通过paramiko进行SFTP上传时,出现无法连接的问题。尽管SSH参数在xshell中能正常登陆,但在库中却不行。经过排查,发现在Windows环境下无需密码即可登陆测试服务器。将库中的密码设置为None后,问题解决。此篇记录这一现象,后续将深入研究原因。
1549

被折叠的 条评论
为什么被折叠?



