From 00e089e503ecd8cafeecbf3e53d3ea93ca57b665 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Mon, 21 Jul 2014 10:32:43 -0500 Subject: [PATCH] Revert "Explicitly set the user option for ssh connections" This reverts commit 0f91add86f7d30e6d895e01bbfddb93a3b5e48df. Fixes #8216 --- lib/ansible/runner/connection_plugins/ssh.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/runner/connection_plugins/ssh.py b/lib/ansible/runner/connection_plugins/ssh.py index ca6fdb3a6f..ec5d6edd34 100644 --- a/lib/ansible/runner/connection_plugins/ssh.py +++ b/lib/ansible/runner/connection_plugins/ssh.py @@ -94,7 +94,8 @@ class Connection(object): self.common_args += ["-o", "KbdInteractiveAuthentication=no", "-o", "PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey", "-o", "PasswordAuthentication=no"] - self.common_args += ["-o", "User=" + (self.user or pwd.getpwuid(os.geteuid())[0])] + if self.user != pwd.getpwuid(os.geteuid())[0]: + self.common_args += ["-o", "User="+self.user] self.common_args += ["-o", "ConnectTimeout=%d" % self.runner.timeout] return self