-
Notifications
You must be signed in to change notification settings - Fork 86
/
TASK_51-Linux_Firewalld_Rules.sh
96 lines (61 loc) · 3.89 KB
/
TASK_51-Linux_Firewalld_Rules.sh
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
-----------------------------------------------------------------------------------------------------------------
Start 2020-11-23 09:09:47
Finished 2020-11-23 09:20:52
-----------------------------------------------------------------------------------------------------------------
TASK_51-Linux_Firewalld_Rules
** This is a Repeat task. This was Task 19 and was complete last 2020-07-19
REQUIREMENT:
The Nautilus system admins team recently deployed a web UI application for their backup utility running on the Nautilus backup server in Stratos Datacenter. The application is running on port 8084. They have firewalld installed on that server. The requirements that have come up include the following:
Open all incoming connection on 8084/tcp port. Zone should be public.
-----------------------------------------------------------------------------------------------------------------
CONTENT:
I. REFERENCES
II. STEPS - SUMMARY
III. COMMANDS USED
IV. STEPS - BREAKDOWN
-----------------------------------------------------------------------------------------------------------------
I. REFERENCES
https://community.kodekloud.com/t/task-1-linux-firewalld-rules/1716/8
https://community.kodekloud.com/t/linux-firewalld-setup-failed-again/4533
-----------------------------------------------------------------------------------------------------------------
II. STEPS - SUMMARY
# 1. SSH into the Backup Server and switch to root.
# 2. Check status of firewalld and the available options.
# 3. Add <port id>/protocol and reload.
# 4. Verify.
-----------------------------------------------------------------------------------------------------------------
III. STEPS - BREAKDOWN
# 1. SSH into the Backup Server and switch to root.
sshpass -p '******' ssh -o StrictHostKeyChecking=no [email protected]
sudo su -
******
# 2. Check status of firewalld and the available options
# Now for this one, since I try to check first the available options in the man pages
# before checking out
# KKC articles for the correct steps, I used --help.
# Then I checked the KKC where I saw multiple articles.
firewall-cmd --help
sudo firewall-cmd --zone=public --list-all
# lists config for firewall
# 3. Add <port id>/protocol and reload
sudo firewall-cmd --zone=public --permanent --add-port=8084/tcp
firewall-cmd --help | grep reload
# tried to searchn correct option on how to reload
sudo firewall-cmd --reload
# 4. Verify.
sudo firewall-cmd --zone=public --list-all
# An additional way to verify is to check the httpd.conf file. This will show the port
grep Listen /etc/httpd/conf/httpd.conf
-----------------------------------------------------------------------------------------------------------------
############################################################################################################
####### ### ### ####### ####### ######### ####### ####### ### ###
#### #### ### ### #### #### #### #### ######### #### #### #### #### ### ###
### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
### ### ### ### ### ### ### ### ### ###
####### ### ### ### ### ######## ####### ####### ### ###
####### ### ### ### ### ######## ####### ####### ### ###
### ### ### ### ### ### ### ### ### ###
### ### ### ### ### ### ### ### ### ### ### ### ###
######### ######### #### #### #### #### ######### ######### ######### ### ###
####### ####### ####### ####### ######### ####### ####### ### ###
############################################################################################################