1Z0-106 practice question 11 of 15

Examine this command: # ssh -L 5011:127.0.0.1:80 [email protected] -f sleep 30 Which two are true upon execution?

Full set: 60 questions
Answer options
A: A reverse tunnel is created back to the local host on port 80.
B: A local port forward is created between client and server. Correct answer
C: A socket remains open for 30 minutes unless a connection is established.
D: A web server is listening on port 5011.
E: An SSH connection process is forked to the background. Correct answer
Correct Answer:
B. A local port forward is created between client and server.; E. An SSH connection process is forked to the background.
Explanation

The command ssh -L 5011:127.0.0.1:80 [email protected] -f sleep 30 performs two primary actions. First, the -L 5011:127.0.0.1:80 option creates a local port forward. This means the local client will listen on port 5011, and any connection to this port will be securely tunneled through the SSH connection and forwarded to port 80 on the remote server (10.10.2.20). Second, the -f option instructs the ssh client to go into the background after successful authentication. The sleep 30 command simply keeps the connection alive for 30 seconds, after which the tunnel will close.

Why Incorrect

A. A reverse tunnel is created with the -R option, not the -L option used here.
C. The sleep 30 command specifies a duration of 30 seconds, not 30 minutes.
D. The ssh client process listens on port 5011 to forward traffic; it is not a web server itself.

References

1. Oracle® Linux 8 Documentation

Managing Network Configuration

Section 10.4.1 Configuring Local Port Forwarding: "The -L option in the ssh command enables you to configure local port forwarding. This form of port forwarding allocates a socket to listen to a port on the local side." This directly supports option B.

2. OpenBSD Manual Pages

ssh(1): The official man page for the ssh client describes the command-line options.

For the -L option: "Specifies that connections to the given TCP port or Unix socket on the local (client) host are to be forwarded to the given host and port

or Unix socket

on the remote side." This confirms the creation of a local port forward (Option B).

For the -f option: "Requests ssh to go to background just before command execution." This directly supports option E.

3. MIT

The Missing Semester of Your CS Education

Lecture 2: Shell Tools and Scripting (January 14

2020): The lecture notes on SSH describe port forwarding: "A very useful feature of SSH is port forwarding. The most common kind of port forwarding is local port forwarding

using the -L flag... This will open port 9999 on your local machine

and forward all traffic to port 8888 of remotehost." This corroborates the functionality described in option B.

Scroll to Top