1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Rep Power

    SSH commands in Python Script

    Hello All
    I am writing a script will execute the ssh commands . For arguments , I am passing the Ip address of the client and the identity file
    The script syntax is
    ./rtnssh.py -stbaddr<STBIP/STBMAC> -i Identity file

    Wanted to know , how I can i have a passthru to the ssh command , if I add additional arguments in the above script
    eg .If I pass "-X " option in the script
    ./rtnssh.py -stbaddr<STB/IP/STBMAC> -X
    it should internally execute the command
    ssh -X STBIP -i identity file
  2. #2
  3. Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Aug 2011
    Rep Power
    def compute_command_string(arguments):
    # statements to make the command string
    # return hairy_command_string

    command = compute_command_string(*args,**kwargs)
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo