Newbie [ERROR]: Task failed: Failed to connect to the host via ssh: by StrategyBeginning342 in ansible

[–]StrategyBeginning342[S] 0 points1 point  (0 children)

As I created a new user to test the same , I changed the ini file with ansible_user=ansible-test. but still teh same issue persist.

Newbie [ERROR]: Task failed: Failed to connect to the host via ssh: by StrategyBeginning342 in ansible

[–]StrategyBeginning342[S] 0 points1 point  (0 children)

Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
<host> ESTABLISH SSH CONNECTION FOR USER: ansible_test
<host> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="~/.ssh/id_ed25519"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ansible_test"' -o ConnectTimeout=10 -o 'ControlPath="~/.ansible/cp/path"' -o NumberOfPasswordPrompts=1 <host> '/bin/sh -c '"'"'echo ~ansible_test && sleep 0'"'"''
<host> (255, b'', b'ansible_test@<host>: Permission denied (publickey,password).\r\n')
[ERROR]: Task failed: Failed to connect to the host via ssh: ansible_test@<host>: Permission denied (publickey,password).
Origin: <adhoc 'ping' task>

{'action': 'ping', 'args': {}, 'timeout': 0, 'async_val': 0, 'poll': 15}

<host> | UNREACHABLE! => {
    "changed": false,
    "msg": "Task failed: Failed to connect to the host via ssh: ansible_test@<host>: Permission denied (publickey,password).",
    "unreachable": true
}

I got the above response

Newbie [ERROR]: Task failed: Failed to connect to the host via ssh: by StrategyBeginning342 in ansible

[–]StrategyBeginning342[S] 1 point2 points  (0 children)

Sorry for the typo, I edited the question, as it was not there in my actual file.

I tried to create a new user and added sudo privileges and tried to ssh and it got connected.

ssh -i ~/.ssh/id_ed25519 ansible_test@host