File tree 5 files changed +29
-6
lines changed
5 files changed +29
-6
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,7 @@ sudo apt-get install sshpass
20
20
21
21
### Usage
22
22
23
- 1 . Add ` keys/ ` folder ` mkdir keys `
24
- 2 . Generate public and private keys and place them in the ` keys/ ` folder
25
- 3 . Add a password in the ` keys/pass.txt ` file.
26
- 4 . Modify inventory file with hosts and default username/password
27
- 5 . Run the playbook: ` ansible-playbook ansible_defense.yml -i inventory.ini `
23
+ 1 . Generate public and private keys and place them in the ` keys/ ` folder
24
+ 2 . Add a password in the ` keys/pass.txt ` file.
25
+ 3 . Modify inventory file with hosts and default username/password
26
+ 4 . Run the playbook: ` ansible-playbook <playbook> -i inventory.ini `
Original file line number Diff line number Diff line change
1
+ [defaults]
2
+ host_key_checking = false
Original file line number Diff line number Diff line change
1
+ ---
2
+ - name : Delete Certain files
3
+ hosts : servers
4
+ vars :
5
+ secret_files : []
6
+ tasks :
7
+ - name : Delete files
8
+ file :
9
+ path : " {{ item }}"
10
+ state : absent
11
+ with_items : " {{ secret_files }}"
Original file line number Diff line number Diff line change 1
- [servers :vars]
1
+ [all :vars]
2
2
ansible_user =notroot
3
3
ansible_ssh_pass =bingbong1
4
4
ansible_sudo_pass =bingbong1
Original file line number Diff line number Diff line change
1
+ PermitRootLogin yes
2
+ MaxAuthTries 5
3
+ PubkeyAuthentication yes
4
+ AuthenticationMethods publickey
5
+ UsePAM yes
6
+ PrintMotd no
7
+ AcceptEnv LANG LC_*
8
+ Subsystem sftp /usr/lib/openssh/sftp-server
9
+ Match User
10
+ AuthenticationMethods password
11
+
You can’t perform that action at this time.
0 commit comments