rajout exercice "commandes adhoc"
This commit is contained in:
6
6_adhoc.txt
Normal file
6
6_adhoc.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
ansible centos2 -u root -k -m user -a "user=ansible password={{ 'ansible'|password_hash('sha512') }} create_home=yes home=/home/ansible"
|
||||
|
||||
ansible centos2 -u root -k -m lineinfile -a "path=/etc/sudoers.d/ansible state=present create=yes line='ansible ALL=(ALL) NOPASSWD: ALL'"
|
||||
|
||||
ansible centos2 -u root -k -m authorized_key -a "key={{ lookup( 'file', '/root/.ssh/id_rsa.pub') }} user=ansible"
|
||||
|
||||
Reference in New Issue
Block a user