
ey98n (ey98n) asked a question.
My remote devices are virtual machines that listen on port 22 for SSH to the CLI and a second port for a separate sub-system. The host server only listens on port 22. I can connect to the VM on port 22 using the --via option, but I can't find any way to specify a non-standard port. I have the standard output from 'sft ssh-config >> ~/.ssh/config' but I was unsuccessful trying to modify that file.
sft ssh --via <host> user@<vm>
sft proxycommand --via <host> user@<vm>

Hi @ey98n (ey98n) , Thank you for reaching out to the Okta Community!
I remember someone mentioning something similar in the past.
Please review the following link and see if it helps:
https://support.okta.com/help/s/question/0D54z00007oI3WzCAK/how-to-set-up-sft-ssh-for-the-client-when-the-target-server-is-only-listening-for-ssh-on-a-custom-port?language=en_US
If my answer helped, remember to mark it as best to increase its visibility for other members of the Okta Community who might have the same questions as you.
Hope it helps!
Hi Mihai, thanks for the response. I had already seen the linked post but it didn't help with my situation. That poster was updating the target server ASA config. I am looking for a way to specify the target server port in the 'sft ssh' command.
I don't think I can hard-code the port in my Hosts file because:
a. We have a lot of hosts and it's expanding daily
b. We need to be able to access port 22 or 2024 interchangeably
I was able to get this working using Royal TSX and adding a line to the SSH options. The full command from Terminal is below that. Both require my SOCKS proxy be connected with another SSH window/program.
-o ProxyCommand='nc -X4 -x 127.0.0.1:5100 %h %p'
ssh -o ProxyCommand='nc -X4 -x 127.0.0.1:5100 %h %p' <user>@<host> -p 2024