Skip to main content
Linux AdministrationMediumMultiple Choice

Linux Administration Question

Statement

Which of the following commands connects to the remote host example.com which has OpenSSH listening on TCP port 2222? (Choose TWO correct answers.)

#ssh#openssh#tcp port#ssh -p#ssh -o port
A

ssh --port 2222 example.com

B

ssh -p 2222 example.com

Correct
C

ssh -o Port=2222 example.com

Correct
D

ssh -o GatewayPort=2222 example.com

E

ssh example.com:2222

Resolution & Explanations

The standard way to specify a custom port in SSH is with the -p flag. The -o option allows passing configuration directives like Port.