Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sudo ansible -m ping hosts
- Enter passphrase for key '/home/myuser/.ssh/id_rsa':Enter passphrase for key '/home/myuser/.ssh/id_rsa':
- Enter passphrase for key '/home/myuser/.ssh/id_rsa':
- $ ansible all -i /tmp/hosts2ping -m ping
- $ ansible all -i /tmp/hosts2ping -a id -k
- SSH password: <enter password>
- 10.1.2.3 | SUCCESS | rc=0 >> uid=nnnn<non-root-account>.....
- $ ansible all -i /tmp/hosts2ping -a id -k -Kb
- SSH password: <enter password>
- SUDO password[defaults to SSH password]: <RETURN>
- 10.1.2.3 | SUCCESS | rc=0 >> uid=0(root).....
- $ ssh-add
- Enter passphrase for .ssh/id_rsa:
- identity added: .ssh/id_rsa
- $ ansible all -i /tmp/hosts2ping -a id # -k not needed
- 10.1.2.3 | SUCCESS | rc=0 >> uid=nnnn<non-root-account>.....
- $ ansible all -i /tmp/hosts2ping -a id -Kb # -k not needed
- SUDO password[defaults to SSH password]: <RETURN>
- 10.1.2.3 | SUCCESS | rc=0 >> uid=0(root).....
- $ ansible all -i /tmp/hosts2ping -a id -k -Kb --become-user=<shared-account>
- SSH password: <enter password>
- SUDO password[defaults to SSH password]: <RETURN>
- 10.1.2.3 | SUCCESS | rc=0 >> uid=43526(<shared-account>).....
Add Comment
Please, Sign In to add comment