nerdexam
CompTIA

XK0-004 · Question #307

An administrator is trying to access a server in a cloud via SSH but is unable to log in. The administrator determines the company's IP address has been blocklisted on the server. Which of the…

The correct answer is C. Add the company's IP address from the /etc/hosts.allow. The /etc/hosts.allow file, part of TCP Wrappers, can explicitly permit a specific IP address to connect, preventing it from being blocked by the server's access control mechanism.

Security

Question

An administrator is trying to access a server in a cloud via SSH but is unable to log in. The administrator determines the company’s IP address has been blocklisted on the server. Which of the following should the administrator do to prevent being blocked in the future?

Options

  • AAdd the company's TLS certificate to the authorized_keys and known_hosts files.
  • BModify the cloud provider security rules to allow all connectors form the company's IP address.
  • CAdd the company's IP address from the /etc/hosts.allow.
  • DTurn on SELinux and enable the SSH context.

How the community answered

(56 responses)
  • A
    4% (2)
  • B
    7% (4)
  • C
    73% (41)
  • D
    16% (9)

Why each option

The /etc/hosts.allow file, part of TCP Wrappers, can explicitly permit a specific IP address to connect, preventing it from being blocked by the server's access control mechanism.

AAdd the company's TLS certificate to the authorized_keys and known_hosts files.

The authorized_keys and known_hosts files manage SSH public-key authentication and host fingerprint verification respectively, neither of which controls IP-based blocking or allowlisting.

BModify the cloud provider security rules to allow all connectors form the company's IP address.

Modifying cloud provider security group rules to allow all connections from the company's IP is overly broad and does not address the server-side blocklist that caused the original SSH denial.

CAdd the company's IP address from the /etc/hosts.allow.Correct

The /etc/hosts.allow file is the TCP Wrappers allowlist that controls which hosts can connect to network services. Adding the company's IP address to this file explicitly grants access, overriding any dynamic blocklist (such as fail2ban) and preventing future SSH denials caused by IP-based restrictions on the server.

DTurn on SELinux and enable the SSH context.

SELinux enforces mandatory access control through security contexts and labels, not IP address allowlisting or SSH connection blocklists.

Concept tested: TCP Wrappers hosts.allow IP access control

Source: https://linux.die.net/man/5/hosts.allow

Topics

#TCP wrappers#hosts.allow#SSH access control#IP allowlisting

Community Discussion

No community discussion yet for this question.

Full XK0-004 Practice