Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does SFTP use port 21 or port 22?

share|improve this question
That depends what port you configured it to use.. – Tom O'Connor Apr 13 '11 at 10:43
Why when everybody asks for default settings somebody thinks that this is the case when user asks something else then that? – holms May 19 '11 at 13:53
Why when anybody asks really trivial question it gets lots of views? Although, seems I know why. ;-P – poige Jul 11 '14 at 5:37
up vote 141 down vote accepted

While TCP port 22 is the general right answer, this is dependent on the fact that SSH is configured to use the standard port and not an alternative port.

As SFTP runs as a subsystem of SSH it runs on whatever port the SSH daemon is listening on and that is administrator configurable.

share|improve this answer
sftp command line syntax for alternate ports sftp -oPort=### user@server.tld – here Nov 8 '13 at 4:06

SFTP usually uses port 22 but can be configured to run on nearly any port.

Port 22 is generally used for connection via SSH. SFTP is just one of protocols which can be run over SSH (others include virtual terminal). In fact, the SFTP is independent and can be run even without using SSH.

SFTP is sometimes called "Secure FTP" which leads to a common confusion with FTPS (which is called "Secure FTP" too).


SFTP - SSH File Transfer Protocol - usually runs over TCP port 22

FTP - plain, old file transfer protocol - usually runns over TCP port 21 (+ opens separate ports for data transfer)

FTP/SSL - FTP over TLS/SSL channel.

FTPS - same as FTP/SSL

Secure FTP - either SFTP or FTPS

More info:

share|improve this answer
I agree that sftp listens on 22, but why does my /etc/services say it's 115 (on Ubuntu)? – Paul A Jungwirth Jul 29 '14 at 18:32
@Paul-A-Jungwirth: It's just the same acronym for unrelated protocol. SFTP on port 115 stands for Simple File Transfer Protocol - The SFTP on port 22 is SSH File Transfer Protocol. – Martin Vobr Jul 29 '14 at 21:44

It uses whatever port SSH is setup to use.

share|improve this answer

Its uses Port 22.

share|improve this answer

SFTP will also use data ports at higher ranges. SSH will remain the control port. It uses more than 22 in most instances...

share|improve this answer
This answer is incorrect. SFTP transfers all data over the SSH connection. No additional port is used. – kasperd Jul 11 '14 at 6:28

default sftp port is 22 the same as ssh , but it can be installed on any port on the server. So you can try to connect default 22and if it fails, contact server administrator to verify port running

share|improve this answer
just so you know, it's best not to answer old questions without providing new information. your answer is substantially the same as the accepted answer (from 2.5 years ago) and as such will probably be downvoted. – Michael Lowman Aug 2 '11 at 17:24
Damn the community here can be petty. – MikeKulls Sep 18 '15 at 5:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.