Skip to content

Commit d403f7c

Browse files
committedMar 27, 2024
Playbook upgrade
1 parent 5e570a9 commit d403f7c

File tree

5 files changed

+29
-6
lines changed

5 files changed

+29
-6
lines changed
 

‎README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ sudo apt-get install sshpass
2020

2121
### Usage
2222

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`

‎ansible.cfg

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[defaults]
2+
host_key_checking = false

‎del_files.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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 }}"

‎inventory.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[servers:vars]
1+
[all:vars]
22
ansible_user=notroot
33
ansible_ssh_pass=bingbong1
44
ansible_sudo_pass=bingbong1

‎sshd_config

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+

0 commit comments

Comments
 (0)
Please sign in to comment.