It is easy to modify the Well Known Port Number for FTP. However, to allow FTP clients access to your site, keep the FTP server port number set at 21 for most installations of Internet Information Server.
If you want to limit access to your FTP server, you can change the control connection (port 21) to a TCP port number greater than 1023 to "hide" your site.
You can change FTP server TCP port numbers by modifying the Systemroot\System32\Drivers\Etc\Services file or by changing their values in the Registry. The setting in the Services file takes precedence over the Registry setting in all cases. That is, by changing the Services file, you affect both the FTP client and the FTP server. By changing the Registry, you affect only the FTP server.
ftp-data 20/tcp
ftp 21/tcp
ftp-data 20/tcp # The # sign designates a comment.
ftp 1234/tcp # FTP port changed to 1234, was 21.
Note This affects the default TCP ports on both the FTP client and the FTP server.
Your FTP server now waits at port 1234 for all FTP client requests and your FTP client connects only to an FTP server at port 1234.
The ftp> prompt appears.
The IP address 127.0.0.1 is the loopback address for your computer. You are specifying 21 as the destination port address. The following message appears:
-> ftp: connect:Connection refused
The port now reverts to the default number specified in the Services file: 1234. You are prompted with the following logon message:
User <127.0.0.1:<none>>:
This verifies that both the FTP client and FTP server are using port 1234.
\System
\CurrentControlSet
\Control
\ServiceProvider
\ServiceTypes
\MSFTPSVC
The DWORD Editor dialog box appears.
cd %systemroot%\system32\drivers\etc
ren services services.ok
This prevents the FTP server from using the port address in the Services file after it has been restarted.
Note This situation affects the default port only on the FTP server.
If you have completed the preceding steps, your FTP server now monitors port 5678 for all FTP client requests and your FTP client connects to an FTP server at port 1234 only.
The ftp> prompt appears.
open 127.0.0.1
open 127.0.0.1 21
open 127.0.0.1 1234
The following message appears:
-> ftp: connect: Connection refused
The port defaults to the number specified in the Registry: 5678. You are prompted with the following logon message:
User <127.0.0.1:<none>>:
This procedure verifies that both the FTP client and FTP server are using port 5678.