8.8 C
Texas

How to install an SFTP/SSH Server on Windows Server 2019.

Hello, how are you? Windows Server users want the ability to install servers with secure protocols. This in order to be able to exchange data and keep it safe from possible intrusions. As a matter of fact, Here at googez.com, we show you how to install an FTP server on Windows Server 2019. But this server is criticized for its lack of security, as the communication is not encrypted. On the other hand, Secure File Transfer Protocol (SFTP) is a secure version of File Transfer Protocol (FTP), which facilitates data access and data transfer over a Secure Shell (SSH) data stream. In other words, it allows you to upload or download files with a server. However, SFTP is considered secure. It protects file transfers through data-in-motion encryption and secure authentication methods. For that reason, in this post, we will see how to install an SFTP/SSH server on Windows Server 2019.

Prerequisites. Installing OpenSSH server.

To achieve better stability on our server, it is imperative to assign a static IP address. If you do not know how to do it, please look here. Furthermore, we are going to install the OpenSSH server, which will allow us to configure access to the SFTP server. Thereupon, it is necessary to enter the settings menu. And once there, select Apps.

Windows Settings>Apps
Windows Settings>Apps

Next, the menu corresponding to Apps and features will be displayed. In this window, click on manage optional features.

On apps and features menu, you need to select manage optional features
On apps and features menu, you need to select manage optional features

In the following window, please scroll down through the different options until you find OpenSSH Server. Check if the service is already installed, if it is not, click on Add a feature

Entering on Add a feature in order to install OpenSSH Server
Entering on Add a feature in order to install OpenSSH Server
- Advertisement -

A list of functions will appear, please navigate until you find OpenSSH Server and select it. Wait until the installation is completed.

Installing OpenSSH Server.
Installing OpenSSH Server.

Configuring the Ssh server to start at Windows startup.

All right, we have already installed both the agent and the OpenSSH server. Now, let is configure the services to be activated every time Windows starts. In order to do that, please press Windows +R, and type services.msc.

Running services
Running services

The service window will then open. Locate OpenSSH Authentication Agent and OpenSSH Server

Locating both OpenSSH services
Locating both OpenSSH services

In the column to the right of the service description, you can see the startup type. In my case, the authentication agent is disabled and the OpenSSH server is manual. What we are going to do is to automatically set the startup. With this in mind, do right-click over the service to enter properties.

Righ-click over the OpnSSH server and select properties
Righ-click over the OpnSSH server and select properties

In the next window, we have to select automatic in startup type and then click on apply. Finally, press Start to begin the service.

Setting automatic on startup type
Setting automatic on startup type

Please do the same procedure with the OpenSSH Authentication Agent.

Check server and client status.

After installing the services and setting up the autostart, we need to check their status. For that, we’ll open a PowerShell with administrator privileges and write the following:

 Get-Service -Name *ssh* 
A powershell showing OpenSSH server is running
A powershell showing OpenSSH server is running

If we have done everything right, we should see this message.

Connect to an SFTP server installed on Windows Server 2019, through OpenSSH.

We can connect to the SFTP server using a client like WinSCP, FTP Rush, in my case I will use FileZilla. Just go to the download page and select download client.

Downloading FileZilla, am SFTP client
Downloading FileZilla, an SFTP client

Run the file, and start the program. In the main window of the program, there are some boxes that we must fill with the credentials of the serve. In host type, the server name, in username adds the name of the user, type the password in the next box and finally type 22 on the Port box. Please note that at the time of installing the OpenSSH server, a firewall rule is automatically created. This rule opens port 22 to allow network access. For that reason, we have to set that number.

Filezilla client running
Filezilla client running

Finally, we have installed and configured the access to an SFTP server in Windows Server 2019. As can be seen, the procedure has been simplified since Microsoft included OpenSSH server in Windows 10 and later versions as Server 2019. Please visit our post about the expiration of accounts in Windows 10. And if you want to keep up with the latest technology, subscribe to our Telegram channel.

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

2 COMMENTS

  1. Nice article. It would be nice if you cover how to restrict SFTP users home directory permission. SFTP user can access the entire drive if no home directory permission defined.

  2. I followed this tutorial and the SFTP server works great, but only for Administrator class profiles, is this a bug or a feature? The default configuration appears to set up the Administrators group for access, and using the AllowUsers or AllowGroups keywords do not appear to work.

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article