How to Set Up and Use an FTP Server in a Windows 11 VM
FTP (File Transfer Protocol) is a standard network protocol used to transfer files between clients and servers. Setting up an FTP server in a Virtual Machine (VM) on a Windows host can help keep your main operating system secure and provide a controlled environment for file transfers. This guide will walk you through the steps to set up an FTP server using IIS (Internet Information Services) on a Windows 11 VM and then demonstrate how to use the FTP command line interface to interact with it.
Step 1: Enable IIS and FTP Server Features
-
Open Control Panel:
- Press
Windows + R
, typecontrol
, and press Enter.
- Press
-
Navigate to Programs and Features:
- Go to
Programs
>Programs and Features
. - Click on
Turn Windows features on or off
in the left pane.
- Go to
-
Enable IIS and FTP Server:
- In the Windows Features dialog, expand the
Internet Information Services
node. - Expand
FTP Server
. - Check
FTP Service
andFTP Extensibility
. - Ensure
Web Management Tools
andWorld Wide Web Services
are also checked.
- In the Windows Features dialog, expand the
-
Install Features:
- Click
OK
and wait for the features to be installed.
- Click
Step 2: Configure the FTP Server
-
Open IIS Manager:
- Press
Windows + R
, typeinetmgr
, and press Enter.
- Press
-
Add FTP Site:
- In IIS Manager, expand the node for your computer in the Connections pane.
- Right-click
Sites
and selectAdd FTP Site
.
-
FTP Site Details:
- Site Name: Enter a name for your FTP site.
- Physical Path: Select the folder you want to use for FTP file storage.
- Click
Next
.
-
Binding and SSL Settings:
-
IP Address: Select the IP address of your VM or leave it as
All Unassigned
. - Port: Default is 21.
-
SSL: For a demo, you can choose
No SSL
. - Click
Next
.
-
IP Address: Select the IP address of your VM or leave it as
-
Authentication and Authorization:
-
Authentication: Select
Basic
. -
Authorization: Choose
Specified users
and enter your Windows username. - Set Permissions to
Read
andWrite
if you want to allow both uploading and downloading. - Click
Finish
.
-
Authentication: Select
Step 3: Configure Firewall Rules
-
Open Windows Firewall:
- Press
Windows + R
, typefirewall.cpl
, and press Enter.
- Press
-
Allow FTP through Firewall:
- Click on
Advanced settings
. - In the left pane, click
Inbound Rules
. - In the right pane, click
New Rule
. - Select
Port
and clickNext
. - Choose
TCP
and specify port 21. - Click
Next
, allow the connection, and complete the rule setup.
- Click on
Step 4: Access the FTP Server
-
Find VM's IP Address:
- Open Command Prompt (
cmd
), typeipconfig
, and find the IP address of your VM.
- Open Command Prompt (
Test FTP Connection:
- You may need to turn off the VM's firewall. Do turn on back once testing is done.
- Ensure the VM's network is set to Bridged-Adapter.
Using the FTP Command Line Interface
Let’s explore some hands-on examples using the FTP command line interface. These examples assume you have an FTP server set up and running.
-
Connecting to an FTP Server:
- Open Command Prompt on your Windows host machine.
- Connect to the FTP server using its IP address:
ftp <ftp_server_address>
-
Logging In:
- Enter your username and password:
Name (ftp_server_address:username): your_username Password: your_password
-
Listing Files:
- List the files in the current directory:
ftp> ls
-
Changing Directories:
- Change to a different directory:
ftp> cd <directory_name>
-
Downloading a File:
- Download a file from the FTP server:
ftp> get <file_name>
-
Uploading a File:
- Upload a file to the FTP server:
ftp> put <file_name>
-
Exiting the FTP Session:
- Exit the FTP session:
ftp> bye
Conclusion
Setting up an FTP server in a Windows 11 VM on your Windows host is a recommended practice for ensuring security and isolation. By following the steps above, you can install and configure an FTP server using IIS on a Windows 11 VM, configure necessary firewall rules, and interact with the server using the FTP command line interface from your Windows host. This setup provides a robust and secure environment for managing file transfers.
Top comments (0)