How to Setup SFTP Server on Windows Server using OpenSSH Free. While sending data over the internet, people usually suffer from many threats. Malicious attackers are always ready to hamper the data send from one place to another.
You may be aware of what I’m talking about: an FTP connection. With an FTP client you can connect one device to another to transfer your data over a network.
But using FTP protocol could not be safe enough sometimes, so what is better file transfer protocol? The better wireless transfer protocol is called SFTP. The S in SFTP stands for secure. It encrypts the connection’s login information during data transfer.
If you want to keep your data safe, it is essential to use an SFTP server, a tool that provides security to data in transit.
In this post, we will introduce SFTP with its main advantages and then move on to the installation and configuration phase on the Windows server with OpenSSH.
Secure File Transfer Protocol or SFTP Server is a protocol that helps you in transferring files securely. Simply put, it is a way of transferring files between a machine over a secure connection.
This transfer can be performed between server to server or client to server configurations. Therefore, with the help of this protocol, you can send confidential files securely over the networks or insecure networks.
Let’s explore how SFTP works in sending files securely from one place to another. The SFTP uses a secure shell data stream that aids in establishing a secure connection and provides a higher level of protection for data while transferring it.
It also uses different encryptions that ensure the data remains unread while moving the data. However, you need to create SSH keys in advance to ignore fraud people from connecting to the server.
There are following advantages that the SFTP Server provides:
Immediate And Effective
With the help of the SFTP server, you can transfer large files easily and effectively. It enables you to transfer multiple files from one server to another in a single go, because of which you tend to save a lot of time. Enterprises using SFTP servers considered it a much better method than emails or cloud. They find exchanging of documents, forms and business critical files to the customer effortless.
Strengthens Data Accessibility
The services that the SFTP or Secure File Transfer Protocol provides are for both client applications and other SFTP servers. It satisfies user to server and server to server facilities. It enables you to foster collaboration and increased productivity of your organization by making data effortlessly accessible.
Improves speed and efficiency in business
Large file transfers are supported by SFTP servers support as well as bulk file transfers. It saves time and leads to better file transfer/sharing methods like email or cloud based solutions.
Fewer Risks
When using SFTP Server you also get encryption, public key authentication, data integrity, and host authentication. It encrypts all the data before transferring, making it non decipherable. It can be decrypted only by the receiver. Authenticating a public key helps you ensure that no imposter is making use of the intended data. For this purpose, you need to provide the receiver with usernames and passwords. This SFTP server also checks whether the data is coming from a trusted source. It verifies both the client and the source before establishing the connection.
SFTP Encryption
Encryption is a strong part of Secure File Transfer Protocol. It secures it from unauthorized access or hackers. Then it converts it into an unreadable format during transmission process, so it’s unreadable. The SSH Encryption is used during the file transfer to secure the process of transfer.
Helps In Achieving Compliance
There are laws that contain provisions that require covered entities to implement secure file transfers. If these protocols fail to comply with the security requirements, that could lead to costly penalties, which can damage your reputation. Not only the SFTP server is built with encryptions but also other security mechanisms, that help in satisfying certain regulatory requirements.
Follow this post to show you how to setup SFTP server on Windows server using OpenSSH free.
What is OpenSSH
The OpenSSH is the open source version of the Secure Shell (SSH) tools for remote login. What it does it encrypts all traffic to prevent attacks. Also the OpenSSH offers a large suite of secure tunnelling capabilities, authentication and configuration options.
To start, the SFTP uses an SSH protocol to transfer files securely between two machines. So you will need to install an OpenSSH server on your Windows server. You can install an OpenSSH server via PowerShell.
Firstly, open the PowerShell window as an administrator, then run the following command to check whether an OpenSSH is installed or not:
Get-WindowsCapability -Online | ? Name -like 'OpenSSH*'
You should see the following output:
Name : OpenSSH.Client~~~~0.0.1.0
State : NotPresent
Name : OpenSSH.Server~~~~0.0.1.0
State : NotPresent
As you can see that an OpenSSH server or client is not installed on your server.
Please run the following command to install the OpenSSH server on your machine:
After the successful installation, you will need to start the OpenSSH service. You can start it using the following command:
Start-Service sshd
Enable the OpenSSH service to start after the system reboot. You can do it using the following command:
Set-Service -Name sshd -StartupType 'Automatic'
During the OpenSSH installation, the Firewall rule for SSH was configured automatically. You can check it by running the following command:
Get-NetFirewallRule -Name *ssh*
You should see the following output:
Name : OpenSSH-Server-In-TCP
DisplayName : OpenSSH SSH Server (sshd)
Description : Inbound rule for OpenSSH SSH Server (sshd)
DisplayGroup : OpenSSH Server
Group : OpenSSH Server
Enabled : True
Profile : Any
Platform : {}
Direction : Inbound
Action : Allow
EdgeTraversalPolicy : Block
LooseSourceMapping : False
LocalOnlyMapping : False
Owner :
PrimaryStatus : OK
Status : The rule was parsed successfully from the store. (65536)
EnforcementStatus : NotApplicable
PolicyStoreSource : PersistentStore
PolicyStoreSourceType : Local
RemoteDynamicKeywordAddresses : {}
Set PowerShell as the default for OpenSSH. You can do it by running the following command:
At this point the OpenSSH server is installed, configured and listens on port 22 on the Windows server. Now, you will need to verify the SSH connection from the remote Linux machine.
On the Linux machine, open your terminal and run the following command to connect to the OpenSSH server:
ssh username@windows-sftp-server-ip
You will be asked to provide the password of the Windows user:
The authenticity of host '208.117.85.180 (208.117.85.180)' can't be established.
ECDSA key fingerprint is SHA256:V6qNABiAL3Ni5viQWM8FV4eMH7IDuoign8kiXUwJ9LQ.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '208.117.85.180' (ECDSA) to the list of known hosts.
ftpuser@208.117.85.180's password:
Provide your password and press the Enter key. Once you are connected to the OpenSSH server. You should get the following shell:
Microsoft Windows [Version 10.0.20348.502]
(c) Microsoft Corporation. All rights reserved.
ftpuser@CLOUD-JET35GPBR C:\Users\ftpuser>
Verify all files and directories of the Windows user using the following command:
dir
You shall get the following output:
Volume in drive C has no label.
Volume Serial Number is 24D4-E65B
Directory of C:\Users\ftpuser
07/10/2022 07:48 AM .
07/10/2022 07:48 AM ..
05/08/2021 08:20 AM Desktop
07/10/2022 07:48 AM Documents
05/08/2021 08:20 AM Downloads
05/08/2021 08:20 AM Favorites
05/08/2021 08:20 AM Links
05/08/2021 08:20 AM Music
05/08/2021 08:20 AM Pictures
05/08/2021 08:20 AM Saved Games
05/08/2021 08:20 AM Videos
0 File(s) 0 bytes
11 Dir(s) 71,437,893,632 bytes free
To connect to the SFTP server, you will need an SFTP client on the remote PC. There are many SFTP client tools available to connect to the SFTP server. In this tutorial, we will use FileZilla to connect to the SFTP server.
1.First, open the FileZilla client on the remote PC. You should see the FileZilla interface on the following screen:
2.Now, click on the SiteManager to create a new SFTP connection. You should see the following screen:
3.Provide your SFTP server IP, Port, select SFTP from the dropdown, username, password, and click the OK button. Once you are connected to the SFTP server. You will get the following screen:
From here, you can easily download and upload files to and from the SFTP server.
How to Setup SFTP Server on Windows Server using OpenSSH Free Conclusion
In this post, we explained how to set up an SFTP server using the OpenSSH free on Windows server. Compared to an FTP server, an SFTP server is a very secured protocol that uses a secure shell data stream and provides a higher level of protection for data transfer between machines. I hope you can now easily set up your own SFTP server to upload and download files from the remote machine.
Please read more of our content on FTP serverhere. I hope you have enjoyed this article and please do not hesitate to contact us for further assistance.
I am a fan of open source technology and have more than 10 years of experience working with Linux and Open Source technologies. I am one of the Linux technical writers for Cloud Infrastructure Services.