nerdexam
CompTIACompTIA

XK0-005 · Question #1710

XK0-005 Question #1710: Real Exam Question with Answer & Explanation

The correct answer is C: ssh -R 8000:localhost:8000 remote. {"question_number": 5, "question": "A Linux administrator needs to forward port 8000 on a remote server to port 8000 on a local server. Which of the following commands should the administrator run on the local server to achieve this goal?", "correct_answer": "C. ssh -R 8000:local

System Management

Question

A Linux administrator needs to forward port 8000 on a remote server remote to port 8000 on a local server. Which of the following commands should the administrator run on the local server to achieve this goal?

Options

  • Afirewall-cmd --add-forward-port=port=8000:proto=tcp:toport=8000:toaddr=remote
  • Biptables -A FORWARD -m state -p tcp -d remote --dport 8000 -j accept
  • Cssh -R 8000:localhost:8000 remote
  • Dsocat TCP4-LISTEN:8000,fork TCP4:remote:8000

Explanation

{"question_number": 5, "question": "A Linux administrator needs to forward port 8000 on a remote server to port 8000 on a local server. Which of the following commands should the administrator run on the local server to achieve this goal?", "correct_answer": "C. ssh -R 8000:localhost:8000 remote", "explanation": "SSH remote port forwarding (-R) creates a tunnel where a port on the remote server forwards traffic to a port accessible from the local machine. The syntax 'ssh -R 8000:localhost:8000 remote' means: bind port 8000 on 'remote', and forward that traffic to localhost:8000 on the local machine. This is the correct direction - the administrator runs it locally to expose the remote port. Option A (firewall-cmd --add-forward-port) routes traffic between local interfaces only and cannot reach a remote server. Option B has incorrect iptables syntax. Option D (socat) would work for local forwarding but not across SSH to a remote host.", "generated_by": "claude-sonnet", "llm_judge_score": 3}

Topics

#SSH#Port Forwarding#Networking#Remote Access

Community Discussion

No community discussion yet for this question.

Full XK0-005 PracticeBrowse All XK0-005 Questions