Guest User

Untitled

a guest
Sep 24th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. sudo ansible -m ping hosts
  2.  
  3. Enter passphrase for key '/home/myuser/.ssh/id_rsa':Enter passphrase for key '/home/myuser/.ssh/id_rsa':
  4.  
  5. Enter passphrase for key '/home/myuser/.ssh/id_rsa':
  6.  
  7. $ ansible all -i /tmp/hosts2ping -m ping
  8.  
  9. $ ansible all -i /tmp/hosts2ping -a id -k
  10. SSH password: <enter password>
  11. 10.1.2.3 | SUCCESS | rc=0 >> uid=nnnn<non-root-account>.....
  12.  
  13. $ ansible all -i /tmp/hosts2ping -a id -k -Kb
  14. SSH password: <enter password>
  15. SUDO password[defaults to SSH password]: <RETURN>
  16. 10.1.2.3 | SUCCESS | rc=0 >> uid=0(root).....
  17.  
  18. $ ssh-add
  19. Enter passphrase for .ssh/id_rsa:
  20. identity added: .ssh/id_rsa
  21.  
  22. $ ansible all -i /tmp/hosts2ping -a id # -k not needed
  23. 10.1.2.3 | SUCCESS | rc=0 >> uid=nnnn<non-root-account>.....
  24.  
  25. $ ansible all -i /tmp/hosts2ping -a id -Kb # -k not needed
  26. SUDO password[defaults to SSH password]: <RETURN>
  27. 10.1.2.3 | SUCCESS | rc=0 >> uid=0(root).....
  28.  
  29. $ ansible all -i /tmp/hosts2ping -a id -k -Kb --become-user=<shared-account>
  30. SSH password: <enter password>
  31. SUDO password[defaults to SSH password]: <RETURN>
  32. 10.1.2.3 | SUCCESS | rc=0 >> uid=43526(<shared-account>).....
Add Comment
Please, Sign In to add comment