What Port Does SFTP Use? | JSCAPE (2024)

Words By Van Glass

Last Updated:

SFTP uses port number 22 by default, facilitating secure data movement over a single internet connection. This SFTP port assignment allows SFTP to offer enhanced security and simplicity compared to other protocols like FTP/S, which require multiple ports. SFTP's reliance on a single port streamlines its operation while maintaining secure, encrypted transfers through SSH.

  1. Blog
    • SFTP
    • ssh
    • sftp server
What Port Does SFTP Use? | JSCAPE (1)

The SSH File Transfer Protocol (SFTP) uses TCP port 22 as its default port number. However, if you or your server administrator wishes to assign a different port number for your SFTP service, the protocol allows it. In this post, we’ll take a closer look at the default SFTP port number and tackle some key considerations when choosing alternate port numbers for your SFTP server.

Before we do that, let’s review what SFTP is.

What is SFTP? A brief review

Also known as Secure File Transfer Protocol, SFTP is an extension of Secure Shell (SSH). It was introduced in SSH v2 or SSH-2 as a method for transferring files. Since SFTP runs over SSH, every SSH server is technically an SFTP server as well. In addition, since SSH listens on port 22 by default, SFTP listens on that port number too.

You must bear in mind that SSH also supports Secure Copy Protocol (SCP), another protocol for transferring files. Like SFTP, SCP also uses the same SSH port number — 22. However, SCP has fewer capabilities compared to the SFTP protocol. If you wish to know the key differences between these two protocols, you can read our article “SCP vs SFTP - 5 Key Comparisons.”

SFTP is a popular alternative to the standard File Transfer Protocol (FTP) due to the former’s array of security features. The FTP protocol’s lack of security features makes it unsuitable for today’s business processes, which often involve personal information, financial data and other sensitive information.

SFTP is equipped with public key cryptography, a cryptographic system that uses pairs of private keys and public keys. Public key cryptography enables data-in-motion encryption, authentication, digital signing and data integrity mechanisms. The same cryptographic system allows you to augment passwords with SSH keys (a.k.a. SFTP keys), thereby allowing you to implement two-factor authentication (2FA). These security features make SFTP perfect for meeting stringent security policies and regulatory requirements.

Don’t confuse SFTP with FTPS. They’re both secure FTP alternatives, but are two different protocols. FTPS stands for FTP-over-SSL, with SSL being the acronym for Secure Sockets Layer, a now-obsolete cryptographic system that used to be a popular choice for securing network-based transactions.

SSL has already been replaced by Transport Layer Security (TLS). However, many security solutions have opted to retain the ‘s’ in relevant acronyms. So, for example, FTPS still uses ‘S’ even if it actually uses TLS under the hood.

When is an SFTP port number needed?

You would mostly need an SFTP port number when you connect to an SFTP service from graphical SFTP clients like WinSCP or FileZilla, or from command-line clients like those built into endpoint device platforms such as Windows, Linux or Mac. You normally submit the port number along with the SFTP service’s IP address or hostname. For example, if your SFTP server is using port 2222, you would typically execute the following SFTP command from the terminal:

sftp -oPort=2222 username@hostname

Note, however, if the remote SFTP service is just using the default port number, 22, you normally won’t have to enter any port number anymore. Port number 22 will be submitted by default. So, for example, when you execute the following SFTP command to connect, you’ll no longer need to specify the port number:

sftp username@hostname

You’ll only need to specify a port number if the SFTP service is using a non-standard port number.

You would also need an SFTP port number when you connect any application to an SFTP service. For instance, when you set up a server-to-server file transfer, you would need an SFTP port number if your trading partner’s server is an SFTP server.

Lastly, you need an SFTP port number if you have to open that port in a network solution such as a firewall or Network Address Translation (NAT) device. Opening that port number on your network solution allows SFTP connections to pass through. Later in this article, we’ll show you how to open port 22 on Windows Server’s built-in firewall.

Picking an alternative to the SFTP default port for SFTP connection

While you can theoretically use a non-standard port number for your SFTP service, there are a few things to consider.

  1. Avoid reserved ports. If possible, avoid selecting port numbers in the range of 0-1023, as these are reserved for well-known services. For example, 80 is reserved for HTTP, 443 is reserved for HTTPS, 21 is reserved for FTP, 25 is reserved for SMTP and so on.
  2. Check port availability. Even if you use a port number outside the range of known reserved ports, make sure you check that port number’s availability. You may use netstat or any similar tool for this purpose.
  3. Document and disseminate. If you have to use a non-standard port, make sure you document it. That way, you or anyone who needs it in the future can easily look it up. Also, make sure you inform everyone who needs to access your SFTP service about the change. Some users might assume you’re using port 22, and will have difficulty connecting to your server.
  4. Update firewalls and network devices. If you have network devices along the path of your SFTP connection that allow or deny access, make sure the settings of those devices are updated with the right port number. Otherwise, you’ll encounter connection issues.

Essential How-Tos involving the SFTP port number

How to check the SFTP port number in Linux?

You have several options for checking the SFTP port number on Linux. We mentioned netstat earlier, so let’s use that command-line tool as an example. Run the following command in the terminal:

sudo netstat -tuln | grep ssh

This command will list all TCP and UDP listening ports along with the numeric addresses and names. The output will then be filtered with grep so that it only shows lines containing "ssh."

How to change the SFTP port in Windows?

We already know that SFTP uses port 22, but you can change that to a different port. To do that, you would need to modify the SSH server configuration file, sshd_config. Follow these steps to make the necessary changes:

  1. Open the sshd_config file with Notepad or ant text editor. In most cases, you’ll find that file in ‘C:\ProgramData\ssh\’ or ‘C:\Program Files\OpenSSH\’.
  2. Search for the line that includes ‘Port 22’.
  3. Change 22 to your desired port number, say for example, ‘Port 2222’.
  4. Save the changes.
  5. Restart your SSH server.

How to change the SFTP port in Linux?

You may follow the same steps as in the previous section, except that you’ll have to look for the sshd_config file in the directory ‘/etc/ssh’ and you’ll have to use nano, vi or some Linux-based text editor.

How to open SFTP port 22 in Windows Server?

To open port 22 in Windows Server, you need to open that port on Windows Server’s built-in firewall. Follow these steps to do that:

  1. Launch “Windows Defender Firewall with Advanced Security”

What Port Does SFTP Use? | JSCAPE (2)

  1. Create an inbound rule. Go to Inbound Rules > New Rule.

What Port Does SFTP Use? | JSCAPE (3)

  1. Select Port as the rule type.

What Port Does SFTP Use? | JSCAPE (4)

  1. Specify the port number. Select TCP > Specific local ports and then enter 22.

What Port Does SFTP Use? | JSCAPE (5)

  1. Select Allow the connection.

What Port Does SFTP Use? | JSCAPE (6)

  1. Specify the profile for which the rule applies. In most cases, you’ll want to apply this rule to all profiles, so tick all checkboxes.

What Port Does SFTP Use? | JSCAPE (7)

  1. Give the inbound rule a name, say, “Allow SFTP,” and then click Finish.

What Port Does SFTP Use? | JSCAPE (8)

Can you use the default FTP port numbers for SFTP?

The default port number for standard FTP is 21. While it’s technically possible to use port 21 for your SFTP service, it’s not recommended. If you review our discussion about picking alternative ports for your SFTP service above, you should see that we discourage the use of reserved ports. Not only can it confuse end users, it can also cause interoperability and connectivity issues with applications that are supposed to connect to that SFTP service.

Next-Level SFTP: Revolutionize your file transfers with JSCAPE MFT by Redwood

Many businesses like to use the SFTP protocol to facilitate business processes, especially those that rely on data transfer and file sharing workflows. However, while regular SFTP servers do a good job at providing data-in-motion security, their capabilities are limited to that. A typical business-to-business (B2B) file transfer demands so much more.

For instance, most B2B file transfers require automation, high availability and system integrations. A regular SFTP server can’t offer you these capabilities out of the box. What you need is a managed file transfer (MFT) solution like JSCAPE MFT by Redwood. JSCAPE MFT supports SFTP along with several other business-grade file transfer protocols like FTP/S, HTTP/S, Applicability Statement 2 (AS2), Odette File Transfer Protocol (OFTP) and many others.

Not only that, JSCAPE MFT also comes with built-in automation, high availability and integration functionality. A JSCAPE MFT deployment is fully equipped to facilitate any B2B file transfer workflow on its own.

JSCAPE MFT can be installed on all major operating systems, including Windows, Linux, UNIX, AIX and macOS. It’s also offered as a cloud-based Software as a Service solution, JSCAPE MFTaaS.

Get Your Free Trial

Would you like to try this yourself? JSCAPE enables you to handle any file type, including batch files and XML.

Request your free trial of JSCAPE MFT Server now.

Related Content

How To Automate An SFTP File Transfer

Install A Linux SFTP Server Via Command Line And Configure Via Web UI

How To Automatically Transfer Files From SFTP To Azure Blob Storage

That Free FTP Server Might Cost More Than You Think

Popular Articles

View more by JSCAPE

  • What Port Does SFTP Use? | JSCAPE (10)

    How to setup SFTP public key authentication on the command line

    14min read —

    SFTP Public Key Authentication enhances security by allowing users to access SFTP services without passwords, favoring automated transfers. The setup process involves creating a .ssh directory, generating a key pair with ssh-keygen, securing permissions, and copying the public key to the server, ensuring a secure connection without the need for passwords

    Read Article
  • What Port Does SFTP Use? | JSCAPE (11)

    Active vs. passive FTP Simplified

    24min read —

    The difference between active FTP and passive FTP modes lies in how connections are made. In active mode, the client initiates the connection with a PORT command, making the server connect back for data. In passive mode, the client uses a PASV command, gets a server port, and starts the data transfer connection.

    Read Article
  • What Port Does SFTP Use? | JSCAPE (12)

    Active-active vs. active-passive high-availability clustering

    7min read —

    Active-active high availability clusters distribute workloads evenly across all nodes, ensuring optimal load balancing. In contrast, an active-passive setup keeps nodes on standby, activating them only when the primary fails, leading to potential delays. Active-active configurations offer reduced downtime and improved performance, making them the preferred choice for continuous system availability.

    Read Article

Posts By Category

Explore All Topics

  • JSCAPE MFT
  • Managed File Transfer
  • Secure File Transfer
  • Tutorials
  • Business Process Automation
  • Videos
  • News
  • SFTP
  • Triggers
  • FTP
  • AS2
  • FTPS
  • File Transfer Clients
  • Ad-Hoc File Transfers
  • Reverse Proxy
  • Accelerated File Transfer
  • file transfer
  • Case Studies
  • mft solutions
  • sftp server
  • ssh
  • webdav
  • webdav server
  • Client Certificate Authentication
  • Configuration
  • EDI
  • JSCAPE SaaS
  • RSA 4096
  • authentication
  • encryption
  • file transfer protocol
  • load balancing
  • security
  • transfer protocols
  • ASCII
  • AWS
  • Amazon S3
  • Clustering
  • DSA
  • DSA vs RSA
  • FTP Server
  • FTP command line
  • FTP/S
  • HMAC
  • High Availability
  • Integration
  • Load
  • Load Balancer
  • MDN
  • OpenPGP keys
  • Product Release
  • RSA vs DSA
  • S3
  • SCP
  • SMTP ports
  • Transfer mode
  • Windows SFTP Client
  • binary mode
  • binary transfer
  • client certificate
  • data streaming
  • decrypt
  • diffie-hellman-group1-sha1
  • digital certificates
  • forward proxy
  • ftp active mode
  • ftp active vs passive
  • ftp client
  • ftp commands
  • ftp passive mode
  • ftp put command
  • gnu privacy guard
  • gpg
  • key exchange
  • key fingerprint
  • licenses
  • mft gateway
  • passive ftp
  • pgp
  • port 25
  • port 587
  • proxy server
  • reverse proxy server
  • sftp port
  • sftp port number
  • windows ftp

Related Content

Read more about SFTP

  • 7 alternatives to an SFTP platform you probably didn’t know

    10min read —

    Explore seven secure alternatives to SFTP for business file transfers, from SCP and OFTP to MFT solutions. Understand the pros and cons of each option, and learn why Managed File Transfer (MFT) might offer the most comprehensive security, automation, and integration features for your organization's needs. Discover the best solution for your file transfer requirements today.

    Read Article
  • Fixing SSH/SFTP client connection issues involving Diffie-Hellman-Group1-SHA1

    7min read —

    If you're troubleshooting SSH/SFTP connection issues related to Diffie-Hellman-Group1-SHA1, you’re likely dealing with outdated and insecure key exchange algorithms. This article explains the root cause of the problem and provides four practical solutions to fix it. Learn how to enhance your connection security and maintain compatibility. Read on to find the best solution for your needs.

    Read Article
  • When SFTP isn’t enough— Signs you need an MFT Solution

    19min read —

    If SFTP limitations hinder your operations, consider an MFT solution for automation, protocol versatility, and advanced security. Explore our detailed blog post to learn when it's time to transition from SFTP to MFT and elevate your data transfers.

    Read Article
What Port Does SFTP Use? | JSCAPE (2024)

FAQs

What Port Does SFTP Use? | JSCAPE? ›

SFTP uses port number 22 by default, facilitating secure data movement over a single internet connection.

Does SFTP use port 21 or 22? ›

Since SFTP runs over the SSH protocol as a subsystem, SFTP uses port 22 by default. The SSH server at port 22 listens for client requests. The port number can be changed, if desired, for testing or other reasons.

Is SFTP port 22 or 115? ›

By default, SFTP uses port 22 for the control connection.

Is port 23 used for SFTP? ›

Unlike FTP over SSL/TLS (FTPS), SFTP only needs a single port to establish a server connection — port 22.

Does SFTP use port 443? ›

SFTP Requires ports 22 or 990 to be open, which is prone to malware including the likes of infamous offenders like Wannacry, Sasser, Nimda, Petya/NotPetya, and more.

How do I know if SFTP port 22 is open? ›

How to check if port 22 is open in Linux
  1. Run the ss command and it will display output if port 22 opened: sudo ss -tulpn | grep :22.
  2. Another option is to use the netstat: sudo netstat -tulpn | grep :22.
  3. We can also use the lsof command to see if ssh port 22 status: sudo lsof -i:22.
Sep 21, 2020

Is port 2222 a SFTP? ›

The option to enable port 2222 for SFTP servers with VPC endpoints is available in all AWS Regions where Transfer Family is available. To learn more about how to configure an alternate port on your SFTP server, visit our documentation.

What is the difference between port 21 and port 22? ›

Anyway, port 21 is used for FTP protocol (and FTPS with explicit TLS/SSL encryption). Port 22 is used for SSH/SFTP protocol. WinSCP automatically uses the correct port number, when you specify the respective protocol. Usually it is not necessary to specify the port number explicitly.

What port format is SFTP? ›

SSH File Transfer Protocol
Communication protocol
AbbreviationSFTP
Based onSecure Shell (SSH)
OSI layerApplication layer (7)
Port(s)22/TCP
3 more rows

How to connect to SFTP port 22? ›

Simply access the firewall settings to allow connections over port 22. For Linux, the process might involve installing SSH (if it isn't already installed) using your distribution's package manager, then allowing SSH/SFTP connections through your firewall with a command like sudo ufw allow ssh .

Are SSH and SFTP the same? ›

SSH (Secure Shell) is a network protocol enabling secure connections between two systems. SFTP (SSH File Transfer Protocol) allows secure file transfer, leveraging SSH for encrypted connections. While SSH is designed for secure command execution, SFTP focuses on secure file transfers.

Does SFTP use TLS? ›

No, SFTP (Secure File Transfer Protocol) does not use TLS (Transport Layer Security). SFTP is actually an extension of the SSH (Secure Shell) protocol and, as such, it utilizes the security mechanisms provided by SSH, which include strong encryption, authentication, and data integrity.

What is the best port for SFTP? ›

SFTP uses port number 22 by default, facilitating secure data movement over a single internet connection. This SFTP port assignment allows SFTP to offer enhanced security and simplicity compared to other protocols like FTP/S, which require multiple ports.

Is SFTP more secure than HTTPS? ›

Overall, both HTTPS and SFTP are security protocols that can be used to transmit sensitive data over the Internet. However, SFTP is generally considered more secure due to the use of public and symmetric key encryption and unique host keys for authentication.

What port does SFTP use for TLS? ›

The ports for each protocol are as follows:
  • FTP: 21 (FTP) 10000-10099 (data transfer)
  • FTPs: 989-990 (TLS 1.0/1.1) 10100-10199 (data transfer)
  • FTPes: 21 (TLS 1.2/1.3) 10000-10099 (data transfer)
  • SFTP: 22 (SSH)

Does FTPS use port 21? ›

FTPS is configured in passive mode, with Port 21 for the initial connection and the port range of 4460 to 4500 for the data connection.

What network ports does SFTP use? ›

SFTP runs over an SSH session, usually on TCP port 22. It has been around since late 1990s. The acronym actually stands for "SSH File Transfer Protocol".

Top Articles
15 Ways to Communicate in a Relationship With a Man
30 Signs of a Weak Man in a Relationship & How to Deal With It
Asist Liberty
Was ist ein Crawler? | Finde es jetzt raus! | OMT-Lexikon
Jefferey Dahmer Autopsy Photos
Sarah F. Tebbens | people.wright.edu
Tv Guide Bay Area No Cable
Our History | Lilly Grove Missionary Baptist Church - Houston, TX
Natureza e Qualidade de Produtos - Gestão da Qualidade
3472542504
United Dual Complete Providers
Binghamton Ny Cars Craigslist
Colts Snap Counts
272482061
Pac Man Deviantart
Theresa Alone Gofundme
Bj Alex Mangabuddy
Iu Spring Break 2024
3S Bivy Cover 2D Gen
Wausau Obits Legacy
Unity - Manual: Scene view navigation
Ubg98.Github.io Unblocked
Pickswise Review 2024: Is Pickswise a Trusted Tipster?
Walgreens Alma School And Dynamite
Vivaciousveteran
Walmart Pharmacy Near Me Open
Cylinder Head Bolt Torque Values
4.231 Rounded To The Nearest Hundred
Yayo - RimWorld Wiki
Yu-Gi-Oh Card Database
What is Software Defined Networking (SDN)? - GeeksforGeeks
Airg Com Chat
Perry Inhofe Mansion
Xfinity Outage Map Lacey Wa
Σινεμά - Τι Ταινίες Παίζουν οι Κινηματογράφοι Σήμερα - Πρόγραμμα 2024 | iathens.gr
Haley Gifts :: Stardew Valley
Uhaul Park Merced
Directions To 401 East Chestnut Street Louisville Kentucky
Laurin Funeral Home | Buried In Work
Craigslist Mount Pocono
Mta Bus Forums
11301 Lakeline Blvd Parkline Plaza Ctr Ste 150
Craigslist Odessa Midland Texas
Www.craigslist.com Waco
Directions To Cvs Pharmacy
Coroner Photos Timothy Treadwell
Autozone Battery Hold Down
Craigslist Sparta Nj
Kidcheck Login
Uncle Pete's Wheeling Wv Menu
Bloons Tower Defense 1 Unblocked
Latest Posts
Article information

Author: Merrill Bechtelar CPA

Last Updated:

Views: 6016

Rating: 5 / 5 (50 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Merrill Bechtelar CPA

Birthday: 1996-05-19

Address: Apt. 114 873 White Lodge, Libbyfurt, CA 93006

Phone: +5983010455207

Job: Legacy Representative

Hobby: Blacksmithing, Urban exploration, Sudoku, Slacklining, Creative writing, Community, Letterboxing

Introduction: My name is Merrill Bechtelar CPA, I am a clean, agreeable, glorious, magnificent, witty, enchanting, comfortable person who loves writing and wants to share my knowledge and understanding with you.