Testing an FTP Connection

Instructor: Louay Chebib
How do you know if your File Transfer Protocol (FTP) Connection is working? What is an FTP Connection and how does work? In this lesson, we will try to answer these questions and show you how to test your (FTP) Connection.

Testing a File Transfer Protocol (FTP) Connection

If you are here, it is likely that you are trying to use an FTP connection or your FTP connection has stopped working. So, what does it take to establish a working FTP connection?

File Transfer Protocol (FTP) sets the rules for computers to send and receive files using a data network. FTP tools come as part of most computer operating systems. FTP tools include error checking that let you know that your file transferred correctly. You can use FTP client software tools to send or receive a file from any computer in the world that is connected to a data communications network.

To send or receive a file, you need to:

  • connect to an FTP server
  • log into the FTP server using your user name and password. Some FTP servers allow for an 'anonymous' sign in.
  • find the file you want to send or receive,
  • transfer the file, and
  • quit the program to close the connection.

Please note that FTP servers can be setup to with a variety of security rules. The traditional setup is for each user ID to be associated with a matching folder. Users are granted specific rights to specific folders.

Test the Connection

Please note that the following examples use sample websites ftp.myftpsite.com, ftp.ftptest.net, and test.talia.net. There is no guarantee these sites will continue to be available on the internet.

Open a command line widow and PING your server. The PING command can be used to test connections to web servers. e.g. At the command line, enter PING ftp.myftpsite.com

C:\>Ping ftp.myftpsite.com

Pinging ftp.myftpsite.com [xxx.xxx.xxx.xxx] with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for xxx.xxx.xxx.xxx:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss)

Since ftp.myftpsite.com does not exist, all ping requests should have timed out.

As a comparison we can try to PING a know FTP server. e.g. ping ftp.ftptest.net

C:\>ping ftp.ftptest.net
Pinging ftptest.net [136.243.154.86] with 32 bytes of data:
Reply from 136.243.154.86: bytes=32 time=146ms TTL=35
Reply from 136.243.154.86: bytes=32 time=147ms TTL=35
Reply from 136.243.154.86: bytes=32 time=145ms TTL=35
Reply from 136.243.154.86: bytes=32 time=147ms TTL=35

Ping statistics for xxx.xxx.xxx.xxx:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 145ms, Maximum = 147ms, Average = 146ms

If you know that the remote site exits, check your firewall settings. The firewall settings on your PC or your router may limit the sites that you may access and/or the type of access available. If you do not administer your own network, check with your system administrator or internet provider to see if the server you are trying to reach is accessible.

Using the Windows FTP Client Program

The following test may be used to test your access to simple FTP sites, but will not work with Secure File Transfer Protocol (SFTP). SFTP is used to safely copy files using FTP transfers. With SFTP, the client software established a Secure Socket Shell (SSH) Protocol based connection to create a secure connection where the FTP transfer can happen. SSH protocol is used by many Internet based applications. It creates a secure connections for exchanging sensitive data like user names and passwords. SFTP uses special client software that is not commonly included with the operating system. One of the most popular open source free SFTP Client software programs is available from WinSCP.

To get a list of FTP command options, From the command prompt enter 'FTP /?'

C:\>ftp /?

Transfers files to and from a computer running an FTP server service
(sometimes called a daemon). Ftp can be used interactively.

FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-A] [-x:sendbuffer] [-r:recvbuf
fer] [-b:asyncbuffers] [-w:windowsize] [host]

-v Suppresses display of remote server responses.
-n Suppresses auto-login upon initial connection.
-i Turns off interactive prompting during multiple file
transfers.
-d Enables debugging.
-g Disables filename globbing (see GLOB command).
-s:filename Specifies a text file containing FTP commands; the
commands will automatically run after FTP starts.
-a Use any local interface when binding data connection.
-A login as anonymous.
-x:send sockbuf Overrides the default SO_SNDBUF size of 8192.
-r:recv sockbuf Overrides the default SO_RCVBUF size of 8192.
-b:async count Overrides the default async count of 3
-w:windowsize Overrides the default transfer buffer size of 65535.
host Specifies the host name or IP address of the remote
host to connect to.

Notes:
- mget and mput commands take y/n/q for yes/no/quit.
- Use Control-C to abort commands.

Inside the FTP program you may type 'help' or '?' at the FTP prompt for a list of available commands.

ftp>help
Commands are: !, delete, literal , prompt, send, ?, debug, ls, put, status, append, dir, mdelete, pwd, trace, ascii, disconnect, mdir, quit, type, bell, get, mget, quote, user, binary, glob, mkdir, recv, verbose, bye, hash, mls, remotehelp, cd, help, mput, rename, close, lcd, open, rmdir

You may also type 'help' and a specific command to get a description of the command.

ftp>help put
put Send one file
ftp>help dir
dir List contents of remote directory
ftp>help help
help Print local help information
ftp>

Another way to check for a connection is to use the FTP command itself. Once you know that you have a connection, use the FTP program to login to the FTP server. e.g. From the command prompt enter 'FTP ftp.myftpsite.com' to start the FTP program. Once in the FTP program enter 'DIR' (the list directory command). Since the FTP server does not exist, the program will respond with 'Not connected.'

C:\>ftp ftp.myftpsite.com
ftp>
ftp>dir
Not connected.
ftp>quit

Now try accessing a working FTP site. e.g. From the command prompt enter 'FTP ftp.ftptest.net' to start the FTP program and access the server. You will be prompted to login using your user name. if you do not give the correct user name, you will be kicked out and the FTP program will close.

C:\>FTP ftp.ftptest.net
Connected to ftptest.net.
220 FZ router and firewall tester ready
User (ftptest.net:(none)): junk
550 Wrong username
Connection closed by remote host.
C:\>

Now try accessing the FTP site 'test.talia.net.' e.g. From the command prompt enter 'FTP test.talia.net' to start the FTP program and access the server. You will be prompted to login using your user name. This site accepts anonymous users. Enter 'anonymous' as your user name and press enter when prompted for a password. You should now be in the FTP site.

To unlock this lesson you must be a Study.com Member.
Create your account

Register to view this lesson

Are you a student or a teacher?

Unlock Your Education

See for yourself why 30 million people use Study.com

Become a Study.com member and start learning now.
Become a Member  Back
What teachers are saying about Study.com
Try it risk-free for 30 days

Earning College Credit

Did you know… We have over 200 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? Study.com has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

Create an account to start this course today
Try it risk-free for 30 days!
Create an account
Support