Hi,
I am trying to execute an Ad-Hoc command which requires sudo privileges on a remote machine.
Below is the command and the error it throws up
kaushik@Machine_1:~$ ansible all -a “cat /etc/shadow” -u kaushik --ask-become-pass
SUDO password:
192.168.101.12 | FAILED | rc=1 >>
cat: /etc/shadow: Permission denied
kaushik@Machine_1~$
If I ssh to the machine and execute the same command “cat /etc/shadow” , it works without any errors.
Any idea how to fix this?
Thanks in advance,
Kaushik