sandervanvugt

Untitled

Jan 24th, 2022
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. ##### On Ansible control as user student
  2. [student@rocky ~]$ history
  3. 1 sudo dnf install epel-release
  4. 2 sudo dnf install -y ansible
  5. 3 sudo sh -c 'echo 192.168.29.229 ubuntu.example.com ubuntu >> /etc/hosts'
  6. 4 sudo sh -c 'echo 192.168.29.230 rocky.example.com rocky >> /etc/hosts'
  7. 5 cat /etc/hosts
  8. 6 sudo useradd -G wheel ansible
  9. 7 sudo passwd ansible
  10. 8 su - ansible
  11. 9 history
  12.  
  13. ##### On Ansible control as user ansible
  14. [ansible@rocky ~]$ history
  15. 1 ssh-keygen
  16. 2 ssh-copy-id ubuntu
  17. 3 ssh-copy-id student@ubuntu
  18. 4 ssh 'student@ubuntu'
  19. 5 echo ubuntu >> inventory
  20. 6 ansible ubuntu -m ping -i inventory -u student -K
  21. 7 ansible ubuntu -m ping -i inventory -u student
  22. 8 history
  23.  
  24.  
Advertisement
Add Comment
Please, Sign In to add comment