mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-25 16:06:43 +00:00
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.
This commit is contained in:
@@ -73,6 +73,7 @@ class Connection(object):
|
|||||||
"-o", "PubkeyAuthentication=no"]
|
"-o", "PubkeyAuthentication=no"]
|
||||||
else:
|
else:
|
||||||
self.common_args += ["-o", "KbdInteractiveAuthentication=no",
|
self.common_args += ["-o", "KbdInteractiveAuthentication=no",
|
||||||
|
"-o", "PreferredAuthentications=hostbased,publickey",
|
||||||
"-o", "PasswordAuthentication=no"]
|
"-o", "PasswordAuthentication=no"]
|
||||||
if self.user != pwd.getpwuid(os.geteuid())[0]:
|
if self.user != pwd.getpwuid(os.geteuid())[0]:
|
||||||
self.common_args += ["-o", "User="+self.user]
|
self.common_args += ["-o", "User="+self.user]
|
||||||
|
|||||||
Reference in New Issue
Block a user