how to use sftp command with different port


I am using the Fedora 9 here for this explaination.

I tried to sftp on remote server for port no 2202. I got the following error on command prompt.

[purab@localhost ~]$ sftp user@example.net -oPort=2202

Connecting to example.net…
ssh: connect to host stylo.smartsourcingglobal.net port 22: No route to host
Couldn’t read packet: Connection reset by peer

Then i tried the following command, than I able to make connection with port

[purab@localhost ~]$ sftp -oPort=2202 user@example.net

Article taken from: http://wpapi.com/2009/09/25/how-to-use-sftp-command-with-different-port/

Leave a comment