gpt4 book ai didi

python - 警告 : Unable to load SSH config file '/root/.ssh/config' in fabric

转载 作者:太空狗 更新时间:2023-10-30 00:48:42 25 4
gpt4 key购买 nike

下面是我的代码:

from fabric.network import ssh_config
from fabric.api import *
from fabric.context_managers import cd

env.use_ssh_config = True

env.hosts = ['172.16.11.16','172.16.11.17','172.16.11.18']
env.user = "monitorx"
env.password = "x@345"

def list_files():
with cd('/home/monitor/Ngrex'):
run('ls')


def get_uname():
run("uname -a")

当我运行 fab list_files 时,出现以下错误:

Warning: Unable to load SSH config file '/root/.ssh/config'

有什么帮助吗?

最佳答案

找到解决方案。简单地在 .ssh/目录中创建一个名为 config 的文件:

touch /root/.ssh/config

关于python - 警告 : Unable to load SSH config file '/root/.ssh/config' in fabric,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37586929/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com