How to Set Up an FTP Server on Windows Server 2019

How to Set Up an FTP Server on Windows Server 2019
Hostman Team
Technical writer
Windows
04.04.2024
Reading time: 5 min

Configuring an FTP server on Windows Server 2019 consists of several stages. First, you need to install the server itself, then create and isolate users, configure a firewall, and establish an FTP connection. This guide will explain all the steps in detail.

First, let's quickly remember what an FTP server is. It is only the first part of the infrastructure that allows data to be transferred between hosts. The second part is the client. A connection is established between them that uses the File Transfer Protocol.

The main advantage of this connection is that it is cross-platform. However, there are many disadvantages: the file sharing is not very fast, and there are security issues. Despite all that, the protocol is still widely used.

Install FTP server

To continue with this guide, you need a host with Windows Server 2019 installed and configured. 

To install an FTP server:

  1. Open the Start menu and launch Server Manager. You will configure the basic settings through this utility.

  2. Click Add roles and features.

  3. The Add Roles and Features Wizard will launch. Click Next.

  4. Select the Role-based or feature-based installation option and click Next.

  5. In the next window, select the default server; this is the server where roles should be installed.

  6. Check the role Web Server (IIS).

  7. In the next window, click Add features.

  8. Skip the next two steps by clicking Next; nothing needs to be changed.

  9. In Role Services select FTP Service and IIS Management Console.

  10.  Check the list of components ready for installation and click Install.

After installation is complete, close the wizard window.

Firewall setup

To configure a firewall that protects an FTP server on Windows, go to the Tools menu in the Server Manager top right and run Windows Defender Firewall with Advanced Security

  1. In the left menu, go to Inbound rules.

  2. In the right menu, select New rule.

  3. In the rule settings, select the Predefined type and the FTP server value.

  4. Select all the options, click Next, and then Finish.

To apply the new configuration, reboot the server.

User management

One of the protocol's main problems is its low level of security. Therefore, you need to be very strict about the list of users who can connect to the server. For this purpose, groups or individual users are configured.

  1. Go to the Tools menu in the Server Manager and select Computer Management.

  2. Go to Local Users and Groups.

  3. Right-click the context menu of the Users item and proceed to create a new account.

  4. Enter your username and password. Select your account settings. For example, you can enable a requirement to change your password the first time you connect. Or vice versa, prohibit changing passwords.

For the system to accept a password, it must meet at least three of the four following security requirements:

  • Have lowercase Latin letters.

  • Have uppercase Latin letters.

  • Have numbers.

  • Have special characters like !, $, #, %.

Deploy your cloud server in minutes

Adding a site

For further work, we need to add an FTP site. After creating users, we return to the Server Manager. All Windows FTP server setup will take place here. 

  1. Go to the Tools and launch the Internet Information Services Manager tool.

  2. In the Connections section, double-click the sever and select Add FTP Site.

  3. Enter the site name and select the folder with its content.

  4. Specify the IP address to connect or set the mode to All Unassigned.

  5. Configure SSL settings. You can choose not to use encryption or enable it and add your own certificate. Click Next.

  6. Select Basic authentication. Grant authorization permission to Specified Users.

  7. Enter the name of the created account.

  8. Grant the read and write permissions.

  9. Click Finish.

Directory Isolation

In one of the previous steps, we showed how to create users which can connect to the server. However, more is needed to provide even minimal security. Another critical point is isolation.

Let's say we are setting up a server for a television company. The company needs to share videos between departments: the camera operators upload the footage, the editors edit it, and the correspondents watch it.

Isolation allows you to ensure that each type of user has access only to specific directories.

We have an FTP site. Let's go to the settings and restrict availability zones between different accounts.

  1. Go to the Tools and launch the Internet Information Services Manager tool.

  2. Right-click on your FTP site and select FTP User Isolation.

  3. Select User name directory and click Apply.

  4. Right-click on the FTP site and add a virtual directory.

  5. Enter your login and, in the line below, the full path to the folder this account can use.The directory should already exist. We recommend using the login in the directory name to make it easier to figure out who can go where.

We have one virtual directory. Let's change access permissions.

  1. Right-click on our new virtual directory and go to editing permissions.

  2. Open the Security tab and click Advanced.

  3. Disable inheritance and save changes.

  4. Return to the Security options.

  5. Click Edit under the list of groups/users.

  6. Remove the Users group and add a new user.

  7. Enter the FTP user name and run name checking.

  8. Click OK to save your changes.

  9. Select the new user, check all the permission checkboxes in the Allow column, and click Apply.

The configuration of the FTP server for Windows is complete.

Connection via FTP

We figured out how to create an FTP server on Windows Server 2019 and set up user accounts. Finally, let's see how to connect to our file storage.

A client is required to establish a connection. One of the most popular is FileZilla. You can also use WinSCP.

To connect, you will need:

  • The server IP address.

  • Name and password for the created account.

After establishing the connection, the user will see the directory you specified in the site settings. If you have configured directory isolation, the user will go to the virtual directory and cannot move to other people's folders.

Windows
04.04.2024
Reading time: 5 min

Similar

Python

How to Install pip on Windows

pip is a utility that turns Python package installation and management into a straightforward task. From Python beginners to coding wizards, having this utility on your Windows computer is a true game-changer. It effortlessly facilitates the setup of crucial frameworks and libraries for your development needs. Automating package management with pip frees up your time and reduces the complications linked to manual installations. Follow this guide to become proficient in configuring pip and overseeing your Python packages seamlessly. pip Setup Process for Windows Here are the guidelines to set up pip on a Windows machine. Step 1: Confirm Installation Verify Python is operational on your device before starting the pip setup. To carry out this operation, run command prompt and apply: python --version   If Python's not present on your system, download it from the official site. Step 2: Download get-pip.py Python's standard installation package automatically includes pip. However, in case of accidental removal, grab the get-pip.py script.  You have a couple of options: either visit the pip.py webpage, or use the curl command for a quick install: curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py Note: Installing Python again to get pip is also an option. However, it can sometimes lead to conflicts with other dependencies or settings. Your existing Python setup stays unchanged with this script. Step 3: Run get-pip.py Move to the script’s location through the command prompt and apply: python get-pip.py This will smoothly install pip on your device. Step 4: Confirm pip Installation Validate the installation by executing: pip --version Applying this command ensures pip is installed on the system. Step 5: Add pip to System PATH If the command doesn't execute properly, update your system PATH with these instructions to incorporate pip: Access Properties by right-clicking on My Computer or This PC from the drop-down menu. Opt for Advanced system settings. Select Environment Variables. Head over to System Variables, spot the Path variable, and choose Edit. Insert the Python Scripts directory into your system PATH, for example, C:\Python39\Scripts. Alternative Ways for pip Installation on Windows Let's discuss a few other ways to effortlessly get pip running on Windows. Via Built-in ensurepip Module From Python 3.4 onward, there's an awesome built-in module named ensurepip. With this tool, pip installation is simplified, eliminating the need for the get-pip.py script. Step 1: Run ensurepip Input the command below to set up pip: python -m ensurepip --default-pip Step 2: Verify pip Installation Check pip version through: pip --version Python Installer Approach for pip Installation Ensure the pip checkbox is marked during the Python setup. Here's how: Step 1: Download Installer Fire up your favorite browser, go to the official Python website, and acquire the most recent installation file. Step 2: Launch the Installer Launch the installer you've downloaded and remember to pick the Add Python to PATH option while setting up. Step 3: Install pip While progressing through the setup, don't forget to enable the Install pip option. Step 4: Validate pip is Installed When the setup wraps up, check pip installation via: pip --version Adjusting pip Version: Upgrade or Downgrade pip can be adjusted to suit your requirements by upgrading or downgrading. Here's how: Upgrading pip To give pip a fresh upgrade, execute: python -m pip install --upgrade pip Downgrading pip To roll back pip, apply: python -m pip install pip==<version> Enter the desired version number to install instead of <version> (e.g., 21.0). Resolving pip Installation Issues: Essential Commands Let's discover common pip installation issues and their fixes: Issue 1: "pip" is not recognized as an internal or external command Solution: This implies the pip path isn't set in your system PATH. Simply follow the instructions in "Step 5" to fix this. Issue 2: Permission Denied Solution: Elevate your command prompt privileges by right-clicking the Command Prompt icon and choosing Run as administrator. Afterward, rerun the commands. Issue 3: Missing Dependencies Solution: Sometimes, you'll run into trouble because of missing dependencies. To correct this, manually install the essential dependencies with pip. For example: pip install package_name Swap out package_name for the appropriate dependency. Utilizing Virtual Environments Employing virtual environments keeps dependencies distinct and avoids any conflicts. Here's how to utilize a virtual environment with pip: Creating a Virtual Environment python -m venv env_name Replace env_name with your desired environment name. Initiating Your Virtual Environment env_name\Scripts\activate Standard pip Commands To explore pip's usage, check these essential commands: Installing a Package pip install package_name Modify package_name to accurately reflect the package you're aiming to install. Uninstalling a Package pip uninstall package_name Showing Installed Packages pip list Showing Package Information pip show package_name Optimal Strategies for Package Management Employ virtual environments to handle dependencies efficiently in multiple projects. Regularly inspect and upgrade your packages to keep everything running smoothly. Prepare requirements files to ease the management of dependencies in your projects. Securing pip Installation Ensuring the protection of packages handled by pip is critical. Here are some tips to keep your environment secure: Maintain project isolation to avoid conflicts and secure installations. Check the trustworthiness and verification of package sources before installing. Always refer to official repositories and examine reviews if they are available. Consistently update pip and your packages to stay protected with the latest security patches and improvements. Periodically review your dependencies for known vulnerabilities. Tools such as pip-audit can assist in identifying and resolving security concerns. Adhere to secure coding standards and steer clear of deprecated or insecure packages. Integrating pip with IDEs pip can be effortlessly embedded into various Integrated Development Environments (IDEs), significantly boosting your development efficiency: VS Code: Utilize the built-in terminal for direct pip command and package management within the editor. PyCharm: Streamline package management by setting up pip configurations via the project interpreter. This simplifies the process of installing and managing packages customized to your project's specific needs. Jupyter Notebook: Employ magic commands in the notebook interface for direct package installation. This provides a smooth and integrated experience for managing dependencies while you work on your interactive notebooks.  Conclusion Windows offers several methods to set up pip, catering to different preferences and requirements. No matter if you select the .py script, use Python's built-in ensurepip module, or enable pip during the initial setup, these approaches will make sure pip is properly configured on your system. This all-in-one guide empowers you to handle and install Python packages with ease. Don't forget, keeping pip updated is essential for ensuring the security and efficiency of your Python setup. Routinely check for updates and keep pip upgraded. In addition, on our application platform you can find Python apps, such as Celery, Django, FastAPI and Flask.
15 January 2025 · 6 min to read
Python

How to Install Python on Windows 10

Python is a high-level programming language used by millions of programmers and developers. It is intuitive, offers many useful tools and libraries, and is essential for working with and analyzing large datasets. However, Python is not pre-installed on Windows operating systems. This guide will walk you through installing Python on Windows 10. Which Version to Choose There are two main versions of Python: Python 2 and Python 3, and they are patible. Python 3 was released in 2008 to address issues found in Python 2. It offers more straightforward, intuitive syntax, a wide range of useful libraries (especially for data analysis), and a large community supports it. Python 2 is no longer supported, unlike Python 3. Therefore, for new projects, you only need Python 3. However, if you need to work on projects written in Python 2, you might still need this version, so we will also explain how to install it. How to Install Python 2 To install Python 2 on Windows 10: Open your browser and go to the official website python.org. Go to the Downloads section. In the Downloads section, find the section for specific releases and locate the version you need. The last Python 2 release is 2.7.18. Click on Download and check the related files. For your operating system, download the 64-bit installer (it is the last file in the list). Once the file is downloaded, open it. Before starting the installation, the installer will allow you to choose the installation path and additional tools. Select the necessary options and start the installation. How to Install Python 3 on Windows There are several ways to install Python, each with its own features, advantages, and disadvantages: Full Installation: Installs all components of Python, which is ideal for most projects. Microsoft Store Installation: Suitable for development environments and running scripts. NuGet Package Installation: Python comes as a ZIP file with the .nupkg extension, designed for continuous integration systems. It does not include the user interface. Ideal for building packages and running scripts. Embeddable Package: Installs a minimal version of Python, often used as part of a larger application or project. Full Installation Using the Official Installer The steps for installing Python 3 from the official website are similar to those for Python 2. Here’s how to install Python 3 on Windows 10: Open your browser and go to python.org. Go to the Downloads section. Click on Download Python x.x.x (the latest version). Once you click it, the installer will start downloading. After downloading, open the installer. If Python 3 is already installed, the installer will offer to update it to the version you just downloaded. If Python is not installed, it will offer a fresh installation. Make sure to check the following options: Installing for all users. Add Python to PATH (this allows you to use Python from the command line). There are two installation options: Install now: Administrator rights are not required. Python will be installed in your user directory. Standard libraries, test suites, a launcher, and pip will be installed. Customize Installation: May require administrator rights. Python will be installed in the Program Files directory. Additional features can be installed. The Python standard library can be precompiled into bytecode. Choose the option that suits you and start the installation. After it finishes, disable the MAX_PATH length limitation to avoid errors related to file path length. To check if the installation was successful, run the command python --version in the command line. If everything went well, you should see an output like this: Python 3.10.8 Python is now installed and ready to use. Installing Python via Microsoft Store To install Python from the Microsoft Store: Open the Microsoft Store application. In the search bar, type Python 3.x, specifying the version you want (e.g., "Python 3.10"). Click Get. The download and installation will begin automatically. Installing Python Using NuGet To install Python on Windows via NuGet: Go to the official website and navigate to the Downloads section. Select the recommended version and download it. After opening the downloaded file, installation will take just a few seconds. To install Python, open Windows PowerShell and run the following commands: For the 64-bit version: nuget.exe install python -ExcludeVersion -OutputDirectory For the 32-bit version: nuget.exe install pythonx86 -ExcludeVersion -OutputDirectory Embeddable Package The embeddable package provides a minimal Python environment. It is distributed as a ZIP file and is intended to integrate Python into larger applications. The embeddable package is not designed for direct user access. You will have a fully isolated Python environment when extracted from the archive. It will be isolated from the user’s operating system, including environment variables (like PATH), the system registry, and any installed packages. The standard Python library is included in the embeddable package as compiled and optimized files. However, this version does not include a package manager (pip) or documentation. You can download the embeddable package from the python.org website: Go to the Downloads section. Clicking on Download will download the regular version, so click the hyperlink for Python for Windows instead. Click Latest Python 3 Release - Python x.x.x. Scroll down to the Files section and choose one of the embeddable versions (for 64-bit or 32-bit systems). Conclusion This guide has covered various methods for installing Python on Windows 10. For more useful Python resources, you can explore our tutorials. If you want to build a web service using Python, you can rent a cloud server at competitive prices with Hostman.
18 October 2024 · 5 min to read
Windows

RDP Protocol: What It Is, What It's Used For, and How It Works

Remote desktop connection to a host can be achieved in various ways, such as using third-party applications like UltraVNC. However, the most common tool for using the Remote Desktop Protocol (RDP) is Microsoft's built-in utility called Remote Desktop. In this article, we'll explore the history of RDP, how it works, and how data is protected during transmission. History of RDP The Remote Desktop Protocol (RDP) was created by Microsoft and initially developed as one of the primary methods for remote access to computers or servers. It was also intended to enable weak local machines to connect to more powerful servers for tasks like complex calculations. Today, RDP is primarily a tool for setting up remote workplaces. Key milestones in the development of RDP: 1998: RDP was first used in Windows NT 4.0 Terminal Server Edition. It continues to be supported in all Windows operating systems, up to Windows 11 and Windows Server 2022. RDP remains a default remote access tool in Windows, despite the existence of other technologies like VNC. There are clients for nearly all major operating systems, including Linux, FreeBSD, macOS, iOS, Android, and more. The current version is RDP 10, which includes features like auto-resizing and enhanced graphics compression using the H.264/AVC codec. General Characteristics of RDP Supported color depths: 32-bit and lower (8, 15, 16, and 24-bit). Data protection: 128-bit encryption using the RC4 algorithm. Other features: Audio redirection, printer and port forwarding, clipboard sharing between the local and remote computers. Citrix Systems played a key role in the early development of remote desktop technology. In the early 1990s, they developed the WinFrame system based on Windows NT 3.51. Citrix eventually collaborated with Microsoft, and in 1997, Microsoft acquired certain rights to Citrix's technology. As a result, Citrix retained rights to the ICA protocol, while Microsoft developed RDP based on the ITU T.120 standard. Citrix and Microsoft remain competitors, with Citrix focusing on high-performance systems and Microsoft leading in the mid-range server market with Terminal Services. Both companies continue to expand their product capabilities to reach more users. Advantages of Terminal Services: Easy application setup for clients. Centralized session management. Functionality tied to active Terminal Services licenses. Network Setup Using Terminal Services Microsoft products allow the use of the RDP protocol in two different modes: for connecting to application servers (Terminal Server Mode) or for managing system settings (Remote Administration Mode). Let's look at both options: Remote Administration Mode All versions of Microsoft Windows support this mode. The only difference is the number of remote connections allowed simultaneously. In desktop versions, only one connection is supported: a local login or a remote host connection. In server versions, the options are broader: two network connections and one local client. Terminal Server Mode This mode is only available on Windows Server editions. The advantage of this mode is that there are no limits on the number of connections—you can have as many as needed. However, you must purchase licenses and configure the system properly to use this mode. The server can be set up as either a dedicated node or a terminal server. Without these steps, access cannot be granted. How RDP Works The Remote Desktop Protocol is an application-layer TCP protocol. Initially, the computers establish a connection. After confirming the connection, the system initiates the RDP session at the transport layer. Once this process is successfully completed, the terminal server begins transmitting the desktop image and allows input from the keyboard and mouse. The display can either be a rendered image or graphical primitives. The system supports the simultaneous use of multiple virtual channels within a single physical connection. This is necessary to enable the following functions: Printing to a printer or data exchange via a serial port. Clipboard functionality and other operations with the disk subsystem. Use of audio playback and recording systems. The parameters for the virtual channels are set at the start, during the initial connection with the host. Two security options are available when initiating a connection: integrated Standard RDP Security and optional Enhanced RDP Security. Let's look at their functionality in more detail and the features of each approach. Standard RDP Security This security approach involves authentication, data encryption, and integrity monitoring through modules integrated into RDP. The encryption uses the RC4 algorithm with a key length between 40-168 bits (depending on the Windows version). When establishing a connection, the system generates a pair of keys to encrypt the information exchanged between the client and the server. The authentication process works as follows: The system generates a pair of RSA keys. It then creates a public key certificate (Proprietary Certificate). This certificate is signed with the RSA key embedded in Windows. The client receives the Proprietary Certificate to access the terminal server. After verifying the certificate, the server's public key is sent to the client. Providing the account and password triggers these actions only upon successful verification. All transmitted data undergoes integrity checks using a Message Authentication Code (MAC) algorithm, based on MD5 and SHA1. The system can be switched to use 3DES encryption, which was introduced in Windows 2003 Server to meet FIPS standards. Enhanced RDP Security The second security option involves using external modules like TLS 1.0 and CredSSP. The TLS protocol was introduced in Windows Server starting with the 2003 release and is used when the client machine supports RDP. Before connecting, it's recommended to check the utility version (RDP 6.0 or higher is required). Users can choose between generating their own certificate or using an existing one from the Windows system. CredSSP (Credential Security Support Provider) is a combined solution that integrates TLS, Kerberos, and NTLM technologies. The advantages of this approach include: Login authorization is verified before completing the RDP connection, saving server resources when dealing with a high number of requests. Encryption and account identification are handled via TLS standards. Single sign-on to the host is supported using Kerberos or NTLM. CredSSP can be selected by enabling the "Use Network Level Authentication" option, available in all operating systems starting with Windows Vista/2008 Server. Terminal Services Licensing  A popular method for accessing Terminal Services is through a "thin client." Its main feature is creating and activating a license server, without which the system will not function (although connections through a "thick client" or to a standard desktop are possible, but only in a remote mode). Licenses are issued in two modes. Without activation, the user is granted a temporary license for the duration of the current session or for a limited period. Once activated, the user is issued a "permanent" license on the server. This process involves issuing a digital certificate confirming the connected workstation's legitimacy. Types of Client Licenses: Temporary Terminal Server CAL: A temporary license limited by a specified period. Device Terminal Server CAL: Tied to a specific device. User Terminal Server CAL: Linked to the specific user defined in the settings. External Terminal Server Connector: Designed for external connections. Let's look at these options in more detail. Time-Based License Upon their first connection to the terminal server, a time-based license is issued to the user. Its validity period is 90 days, regardless of the client's activity. If a second connection is successfully established, the server will attempt to assign a permanent license to the client machine. Licenses must be available in the server's storage for this to happen. Device-Based License This option is designed for a client working from a specific physical device. The license is valid for a period ranging from 52 to 89 days. If 7 or fewer days remain before expiration, the server will attempt to replace it with a permanent license upon any connection attempt. If the device is changed, the cycle will restart from the beginning. User-Based License The user-based license is the most flexible option, as it allows users to work from any device, creating convenient conditions for deploying remote workspaces. A notable feature of this mode is that Terminal Services does not have a built-in connection counter. As a result, when additional clients connect, the number of available licenses remains unchanged. This does not comply with Microsoft's licensing rules, but it is a known fact. If you need to issue both device and user licenses simultaneously, the server must be configured for device-based licensing. In a mixed setup, there will also be no counter for tracking different client connections, and limitations can only be enforced by linking them to specific hardware. External User License This is a special type of license for granting rights to external users. It does not limit the number of clients, regardless of the volume specified, because, under the EULA agreement, a dedicated server must be allocated for such users. This restricts external clients' access to corporate sessions. This type of license is not very popular due to its high cost. RDP Connection on macOS Microsoft has released a Remote Desktop utility for macOS, which you can download from the App Store. The connection process is similar to that on Windows: first, you enter the server's IP address or domain, and then, when prompted, enter the username and password of the user who has remote access rights. After launching, you may receive a warning about an untrusted certificate. To resolve this, simply click "Show Certificate" and select the "Always trust..." option. From then on, the system will connect without asking again. Remote Desktop Connection on Ubuntu When connecting from Windows to a remote host running Ubuntu, the Remote Desktop utility is used, just like on Windows. However, you need to prepare the Ubuntu server by installing support for the technology: sudo apt install xrdp After installation, start the service: sudo systemctl status rdp If you're using Linux as the local machine, the Remmina utility will be useful. You will need to switch the protocol from VNC to RDP. Despite the different systems, the user experience will feel seamless. Other Linux clients include Gnome Connection, Vinagre, Xfreerdp, and Rdesktop. To install the Remmina package: sudo apt-add-repository ppa:remmina-ppa-team/remmina-nextsudo apt-get updatesudo apt-get install remmina remmina-plugin-rdp libfreerdp-plugins-standard Conclusion We've completed our overview of the RDP protocol, covering what it is and how it works. One final note is that a license server can be assigned one of two roles: Domain or Workgroup License Server – operates within a domain or workgroup. Entire Enterprise License Server – operates within an organization. The choice affects how the license server is scanned. In the first case, the system searches through Active Directory, while in the second, it uses NetBIOS broadcast requests.  
16 October 2024 · 9 min to read

Do you have questions,
comments, or concerns?

Our professionals are available to assist you at any moment,
whether you need help or are just unsure of where to start.
Email us
Hostman's Support