How to set up a Windows SFTP server

Configurare noua (How To)

Situatie

Solutie

To install a Windows SFTP server, you need to download OpenSSH and open the corresponding SSH port so that the SFTP server and client can communicate with each other.

Step 1: Install OpenSSH

Download the latest version of OpenSSH. This can be done from GitHub. Once you’ve downloaded the latest version, right-click to open PowerShell and select Run as administrator. Then go to the OpenSSH folder:

cd "C: \Program Files\OpenSSH"

Use the command dir to list the files in the directory.

PowerShell: File list in the OpenSSH folder
PowerShell: File list in the OpenSSH folder

Step 2: Activate SSHD and the SSH agent

Both the SSH daemon and the SSH agent can be installed with a command.

powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1

Once they have been successfully installed, you can close the PowerShell. You can manually start the SSH daemon or choose to have it activated with every restart. In Services.msc, you can set it up so that the SSH daemon automatically starts on boot.

Step 3: Open an SSH port

SSH uses port 22 as its standard port. Since Windows doesn’t typically come with SSH preinstalled, this port is normally closed. You can manually open it using Windows Firewall. Open Windows Defender Firewall and select New Rule under Inbound Rules.

Windows Defender Firewall: Add inbound rules
Windows Defender Firewall: Adding inbound rules

In the next window, select Port and click on Next.

Windows Defender Firewall: Select port rule
Windows Defender Firewall: Select port rule

Select the TCP protocol and set “22” as a port.

Windows Defender Firewall: Setting SSH port 22
Windows Defender Firewall: Setting SSH port 22

In the next window, keep the connection selected and tick the box next to Private under Profile.

Windows Defender Firewall: Profile settings
Windows Defender Firewall: Profile settings

You can also add a name for the new rule. In our example, we’ve used the name “OpenSSH”. You can also add a description. Once you’re done, you can close the port settings by clicking Finish.

Windows Defender Firewall: Setting a name for the new rule
Windows Defender Firewall: Setting a name for the new rule

Step 4: Create SFTP connection

To connect to the SFTP server, you will need an SFTP client. Our example uses FileZilla, but you can also use WinSCP or Swish. One advantage of Swish is that it’s directly available in Windows Explorer. To configure the SFTP client, you need to enter the following information:

  • Connection type (SFTP)
  • IP address/Hostname
  • Username
  • Password
  • Port (usually 22)

Once you’re done, you can connect to the SFTP server. In our example, this is on the left-hand side of your local computer. On the right, you’ll see the folder structure of the server.

FileZilla: Connect to the SFTP server

Step 5: Upload files to the Windows SFTP server

Upload a file to the SFTP server by moving it to the file folder on the right-hand side or by right-clicking and selecting Upload.

FileZilla: Upload file

Tip solutie

Permanent

Voteaza

(0 din 0 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?