diff --git a/tsshbatch.py b/tsshbatch.py index a467995..ea83a1a 100755 --- a/tsshbatch.py +++ b/tsshbatch.py @@ -20,7 +20,7 @@ CMDINCL = PROGENV + "CMDS" HOSTINCL = PROGENV + "HOSTS" -CVSID = "$Id: tsshbatch.py,v 1.225 2016/01/18 22:05:17 tundra Exp $" +CVSID = "$Id: tsshbatch.py,v 1.226 2016/01/18 22:19:30 tundra Exp $" VERSION = CVSID.split()[2] CPRT = "(c)" PROGDATE = "2011-2016" @@ -684,8 +684,13 @@ ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + keyfiles = None + if host in SSH_Configuration: + entry = SSH_Configuration[host] + keyfiles, host = entry[0], entry[1] + if KEYEXCHANGE: - ssh.connect(host, username=user, timeout=time) + ssh.connect(host, username=user, key_filename=keyfiles, timeout=time) else: ssh.connect(host, username=user, password=pw, allow_agent=False, look_for_keys=False, timeout=time)