GCIH · Question #168
You want to create an SSH tunnel for POP and SMTP protocols. Which of the following commands will you run?
The correct answer is D. ssh -L 110:mailhost:110 -L 25:mailhost:25 -1 user -N mailhost. Tunneling both POP3 (port 110) and SMTP (port 25) over SSH requires two fully specified -L port forward arguments along with the target user, host, and the -N flag to suppress remote command execution.
Question
You want to create an SSH tunnel for POP and SMTP protocols. Which of the following commands will you run?
Options
- Assh -L 110:mailhost:110 -L 25
- Bssh -L 110:mailhost:110 -L 25:mailhost:25 -1
- Cssh -L 25:mailhost:110 -L 110
- Dssh -L 110:mailhost:110 -L 25:mailhost:25 -1 user -N mailhost
How the community answered
(57 responses)- A9% (5)
- B5% (3)
- C14% (8)
- D72% (41)
Why each option
Tunneling both POP3 (port 110) and SMTP (port 25) over SSH requires two fully specified -L port forward arguments along with the target user, host, and the -N flag to suppress remote command execution.
This command omits the remote host and remote port for the SMTP -L 25 tunnel, making the syntax invalid and leaving SMTP port forwarding unconfigured.
This command correctly specifies both port forwards and protocol flags but is missing the required username and destination host at the end, so SSH cannot establish the connection.
This command incorrectly maps local port 25 to remote port 110 instead of 25, which cross-maps SMTP to the POP3 port and would not properly forward SMTP traffic to its correct remote port.
The command `ssh -L 110:mailhost:110 -L 25:mailhost:25 -1 user -N mailhost` correctly creates two local port forwards using the syntax local_port:remote_host:remote_port, mapping local port 110 to POP3 and local port 25 to SMTP on mailhost. The -N flag instructs SSH not to execute a remote command, which is appropriate for a pure tunneling session. The -1 flag forces SSH protocol version 1, and the target user and host are properly specified at the end of the command.
Concept tested: SSH local port forwarding for POP3 and SMTP tunneling
Source: https://man.openbsd.org/ssh
Topics
Community Discussion
No community discussion yet for this question.