Skip to content

Using sftp on an alternate port

Unlike ssh and scp, sftp does not have a “-p” or “-P” flag to specify an alternate port. Instead, if the host you are connecting to has ssh running on a port other than 22, you need to use the “-o” flag:

sftp -oPort=2345 remote.hurricane-ridge.com

According to the man page, “-o” allows you to “give options in the format used in the configuration file.”

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*