fear_matrix
fear_matrix

Reputation: 4960

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

Below is my code:

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")

When I run fab list_files then I get the below error:

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

Any help?

Upvotes: 7

Views: 2998

Answers (1)

fear_matrix
fear_matrix

Reputation: 4960

Found the solution. Simple create a file in .ssh/ directory with the name config:

touch /root/.ssh/config

Upvotes: 11

Related Questions