from fabric import tasks
from fabric.api import run
from fabric.api import env
from fabric.network import disconnect_all
import os
import platform
import csv
import subprocess
env.hosts = [
‘10.0.0.7’,
‘10.0.0.6’
]
m=len(env.hosts)
def pro():
global ch
global y
global n
y=None
n=None
ch=None
#m=len(env.hosts)
#print m
res1= run(‘ifconfig’)
def main():
uts_dict = tasks.execute(pro)
disconnect_all()
if name == ‘main’:
main()
When I run the above code in terminal it asks for password for both ip’s(10.0.0.6,10.0.0.7)
After giving the password I get the output.
How can I run the the program so that it does not ask for password and I directly get the output in terminal?