CompTIA Linux+ Powered by LPI (LX0-104) — Question 22
Which of the following commands connects to the remote host example.com which has OpenSSH listening on TCP port 2222? (Choose TWO correct answers.)
Answer options
- A. ssh --port 2222 example.com
- B. ssh -p 2222 example.com
- C. ssh -o Port=2222 example.com
- D. ssh -o GatewayPort=2222 example.com
- E. ssh example.com:2222
Correct answer: B, C
Explanation
The correct answers are B and C because both options specify the port number for the SSH connection correctly. Option A is incorrect as '--port' is not a valid flag for SSH. Option D refers to 'GatewayPort', which is unrelated to specifying the connection port, and option E uses an incorrect syntax for the SSH command.