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?
Found the solution. Simple create a file in .ssh/ directory with the name config
:
touch /root/.ssh/config
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With