今天遇见一个以前没遇见的问题,用了自己写的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,居然就好了,特此记录,以后研究下怎么回事。