-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcloudconfig.yaml
More file actions
46 lines (41 loc) · 953 Bytes
/
cloudconfig.yaml
File metadata and controls
46 lines (41 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#cloud-config
groups:
- docker
users:
- name: yac-user
groups:
- sudo
- docker
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
ssh_authorized_keys:
- <YOUR_PUBLIC_KEY>
packages:
- fail2bin
- ufw
- docker.io
- docker-compose
package_update: true
package_upgrade: true
write_files:
- path: /etc/ssh/sshd_config.d/ssh-hardening.conf
content: |
PermitRootLogin no
PasswordAuthentication no
Port 2222
KbdInteractiveAuthentication no
ChallengeResponseAuthentication no
MaxAuthTries 2
AllowTcpForwarding no
X11Forwarding no
AllowAgentForwarding no
AuthorizedKeysFile .ssh/authorized_keys
AllowUsers yac-user
runcmd:
- printf "[sshd]\nenabled = true\nport = ssh, 2222\nbanaction = iptables-multiport" > /etc/fail2ban/jail.local
- systemctl enable fail2ban
- ufw allow 2222
- ufw allow 80
- ufw allow 8080
- ufw enable
- reboot