fabric连接远程主机时报:Unable to connect to port 22 on 的异常?
按照 fabric 的官方文档写的一段简单代码:
from fabric.api import run
def host_type():
run('uname -s')
运行时:zmrenwu@sheepx:~/test_folder$ fab -H yangxg.top host_type
主机的域名是: yangxg.top
得到如下的异常信息:
zmrenwu@sheepx:~/test_folder$ fab -H yangxg.top host_type
[yangxg.top] Executing task 'host_type'
[yangxg.top] run: uname -s
Fatal error: Low level socket error connecting to host yangxg.top on port 22: Unable to connect to port 22 on or 23.83.225.228 (tried 1 time)
Underlying exception:
Unable to connect to port 22 on or 23.83.225.228
Aborting.
为什么会出现这种情况?可以保证远程主机的 ssh 服务已经开启了的,使用 putty 等工具可以连接。fabric 版本是 1.10.2, python 版本 2.7
求指教!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你是不是改了
ssh
的端口号?