从 python 执行 scp 时出错
此代码给出以下错误:
os.system("scp %s:/export/home/sample/backup.sql %s:/home/rushi/abc.sql" % (a, b))
Permission denied (publickey,keyboard-interactive).
lost connection
a 和 b 是接受用户名和计算机名作为参数的命令行参数:
例如: [电子邮件受保护] 。
this code is giving following error:
os.system("scp %s:/export/home/sample/backup.sql %s:/home/rushi/abc.sql" % (a, b))
Permission denied (publickey,keyboard-interactive).
lost connection
a and b are the command line arguments which accept user name and machine name as arguments:
eg: [email protected] .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这与 Python 无关,而与 SSH 有关。
它告诉您登录失败。我建议您要么整理基于密钥的身份验证,要么向其传递密码。
请参阅:http://unixhelp.ed.ac.uk/CGI/ man-cgi?ssh+1
或者不要尝试使用
scp
命令,而是使用 纯 python 方法。This has nothing to do with Python and everything to do with SSH.
It's telling you you have failed to log in. I suggest you either sort your key-based auth out or pass it a password.
See: http://unixhelp.ed.ac.uk/CGI/man-cgi?ssh+1
Or instead of trying to use the
scp
command, use a pure-python method.该错误来自 scp。如果您自己运行该命令会发生什么?您希望使用公钥进行连接还是必须输入密码?
That error is coming from scp. What happens if you run the command yourself? Are you expecting to use public key to connect or do you have to enter a password?