ssh, sftp, scp, tftp port fun


To start an SSH session on a specific port:

$ ssh -p 22222 host

To download a file over SCP on a unique port:

$ scp -P 22222 host:file .

To start an SFTP session on a specific port:

$ sftp -oPort=22222 host

To start an tftp session on a specific port:

$ tftp host 22222

Hashtag Linux userland! Time to break out some port of another nature.

UPDATE: I wrote about SFTP ports seven years ago. I guess my memory is worse than I thought, though at least it hasn’t affected my memory.

Author bio and support


Ruben Schade is a technical writer and infrastructure architect in Sydney, Australia who refers to himself in the third person. Hi!

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

If you found this post helpful or entertaining, you can shout me a coffee or send a comment. Thanks ☺️.