Initiating SFTP connections with a non standard port

Software

Network transmit icon from the Tango Desktop ProjectAnother quickie to serve as much as a reminder for me as a how-to post.

If you've configured the SFTP daemon on your target system to use a non-standard port as part of your security precaution mix, you can't pass this port number by appending a colon and the port to the address. Instead, use the SFTP options flag to declare the port:

% sftp -oPort [PORT] (USER@)[ADDRESS]

For example, to connect as user NotBillKurtis to a local 192.168.1.128 server on port 50000 you would enter:

% sftp -oPort 50000 NotBillKurtis@192.168.1.128

Author bio and support

Me!

Ruben Schade is a technical writer and IaaS engineer in Sydney, Australia who refers to himself in the third person in bios. Wait, not BIOS… my brain should be EFI by now.

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or buy some silly merch. Thanks!