LPIC-2 Network Client Management Practice Question
A developer frequently needs to access a remote database server that is only accessible via SSH from a jump host. To simplify access, the administrator wants to create a local port forward so that the developer can connect to localhost:3306 and reach the remote database's MySQL port 3306. Which SSH command achieves this?
⚠ Common exam trap
Many candidates confuse local port forwarding (`-L`) with remote port forwarding (`-R`) or misinterpreting the destination address as being resolved from the client's network instead of the SSH server's network.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
ssh -L 3306:db.internal:3306 user@jump.example.com
`ssh -L 3306:db.internal:3306 user@jump.example.com` forwards local port 3306 to `db.internal:3306` through the jump host, allowing the developer to connect to localhost:3306 and reach the remote database. Option E is incorrect because `-L 3306:localhost:3306` forwards to the jump host's own localhost, not the database server; this would only work if the database were running on the jump host itself, which is not the case.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
ssh -J user@jump.example.com -L 3306:localhost:3306 db.internal
Why it's wrong here
Uses `-J` for a jump host, but also specifies `-L 3306:localhost:3306 db.internal`, which incorrectly resolves `localhost` from the client's perspective and targets an extra host. The syntax is wrong and does not achieve the required forwarding.
- ✓
ssh -L 3306:db.internal:3306 user@jump.example.com
Why this is correct
Correct: `-L 3306:db.internal:3306` forwards local port 3306 to `db.internal:3306` on the jump host's network, so connecting to localhost:3306 reaches the remote database.
- ✗
ssh -L localhost:3306:db.internal:3306 user@jump.example.com
Why it's wrong here
Adds an extra `localhost:3306` before the destination, which is unnecessary and causes incorrect syntax. The correct format is `-L [local_port:]remote_host:remote_port`.
- ✗
ssh -R 3306:localhost:3306 user@jump.example.com
Why it's wrong here
Uses `-R` for remote port forwarding, which would forward a port on the remote side to the local machine, not the desired local forward.
- ✗
ssh -L 3306:localhost:3306 user@jump.example.com
Why it's wrong here
Incorrect: `-L 3306:localhost:3306` forwards local port 3306 to the jump host's localhost port 3306, not to `db.internal`. The database is not running on the jump host, so this would not reach the target database.
Go deeper
Related to this question
About these practice questions
Courseiva writes every LPIC-2 question from scratch — 507 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This LPIC-2 practice question is part of Courseiva's free LPI certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LPIC-2 exam.