Create an SSH SOCKS proxy listening on client localhost:1080 so each application can choose its destination.
Which command is appropriate?
-D creates a local SOCKS proxy whose destination is selected dynamically by the application.
Detailed explanation
ssh -L 1080 trainee@gateway.example.testIncorrect. -R creates a remote-side listener, not a local SOCKS proxy.
Incorrect. -R creates a remote-side listener, not a local SOCKS proxy.
ssh -R 1080 trainee@gateway.example.testCorrect. -D creates a dynamic SOCKS proxy on the specified local port.
Correct. -D creates a dynamic SOCKS proxy on the specified local port.
ssh -D 1080 trainee@gateway.example.testIncorrect. -L requires a fixed destination host and port.
Incorrect. -L requires a fixed destination host and port.
ssh -p 1080 trainee@gateway.example.testIncorrect. -p is the SSH server connection port.
Incorrect. -p is the SSH server connection port.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s\n' 'ssh -D 1080 trainee@gateway.example.test'Expected result
ssh -D 1080 trainee@gateway.example.testKey points
- -D
- SOCKS
- Dynamic forwarding
Notes
- Environment: OpenSSH port forwardingの構文確認
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.