CAS-002 · Question #558
An administrator is unable to connect to a server via VNC. Upon investigating the host firewall configuration, the administrator sees the following lines: - A INPUT -m state --state NEW -m tcp -p…
The correct answer is B. A line needs to be added. VNC uses TCP port 5900 by default, but no firewall rule for that port exists in the listed configuration. A new ACCEPT rule for port 5900 must be added.
Question
An administrator is unable to connect to a server via VNC. Upon investigating the host firewall configuration, the administrator sees the following lines:
- A INPUT -m state --state NEW -m tcp -p tcp --dport 3389 -j DENY
- A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j DENY
- A INPUT -m state --state NEW -m tcp -p tcp --dport 10000 -j ACCEPT
- A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j DENY
- A INPUT -m state --state NEW -m tcp -p tcp --sport 3389 -j ACCEPT
Which of the following should occur to allow VNC access to the server?
Options
- ADENY needs to be changed to ACCEPT on one line.
- BA line needs to be added.
- CA line needs to be removed.
- DFix the typo in one line.
How the community answered
(22 responses)- A18% (4)
- B73% (16)
- C5% (1)
- D5% (1)
Why each option
VNC uses TCP port 5900 by default, but no firewall rule for that port exists in the listed configuration. A new ACCEPT rule for port 5900 must be added.
Changing DENY to ACCEPT on an existing line would only open a port already listed (3389, 22, or 80), none of which are the VNC port 5900.
VNC listens on TCP port 5900 by default, yet none of the listed iptables rules reference that port. Without an explicit ACCEPT rule, traffic to port 5900 is dropped by the default policy. Adding a rule such as '-A INPUT -m state --state NEW -m tcp -p tcp --dport 5900 -j ACCEPT' would permit incoming VNC connections.
Removing a line would eliminate an existing rule but would not create the missing ACCEPT entry for port 5900, so VNC traffic would still be blocked.
While DENY is not a standard iptables target (correct targets are DROP or REJECT), correcting that typo does not add any rule for port 5900 and would not restore VNC connectivity.
Concept tested: Linux iptables firewall rules and VNC default port
Source: https://linux.die.net/man/8/iptables
Topics
Community Discussion
No community discussion yet for this question.