Linux Foundation Certified System Administrator (LFCS) — Question 116
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 commands specify the port for the SSH connection correctly using the '-p' option and the '-o Port=' option respectively. Option A is incorrect due to the use of '--port', which is not a recognized option in SSH, while D and E do not correctly set the port for the SSH connection.