From 2bdba17a854b841d53370187020880d10af4899d Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Tue, 20 Aug 2013 21:51:14 +0200 Subject: [PATCH] make sure ssh do not ask password For some reason, ssh seems to ask for password even when PasswordAuthentication is set to no, adding PreferredAuthentications with the 2 options removed do the trick. --- lib/ansible/runner/connection_plugins/ssh.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ansible/runner/connection_plugins/ssh.py b/lib/ansible/runner/connection_plugins/ssh.py index ece1021f855..7fa08f3292c 100644 --- a/lib/ansible/runner/connection_plugins/ssh.py +++ b/lib/ansible/runner/connection_plugins/ssh.py @@ -73,6 +73,7 @@ class Connection(object): "-o", "PubkeyAuthentication=no"] else: self.common_args += ["-o", "KbdInteractiveAuthentication=no", + "-o", "PreferredAuthentications=hostbased,publickey", "-o", "PasswordAuthentication=no"] if self.user != pwd.getpwuid(os.geteuid())[0]: self.common_args += ["-o", "User="+self.user]