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 ConnectionPlease 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
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 184.108.40.206 with 32 bytes of data:Reply from 220.127.116.11: bytes=32 time=146ms TTL=35Reply from 136.
243.154.86: bytes=32 time=147ms TTL=35Reply from 136.243.154.
86: bytes=32 time=145ms TTL=35Reply from 18.104.22.168: 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 ProgramThe 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:recvbuffer -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>helpCommands 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 putput Send one fileftp>help dirdir List contents of remote directoryftp>help helphelp Print local help informationftp>|
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.comftp>ftp>dirNot 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.netConnected to ftptest.net.220 FZ router and firewall tester readyUser (ftptest.
net:(none)): junk550 Wrong usernameConnection 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.
|C:>ftp test.talia.netConnected to test.talia.
net.220 ProFTPD 1.3.
5rc3 Server (test.talia.net) No InterWiki reference defined in properties for Wiki called “”!User (test.talia.net:(none)): anonymous331 Anonymous login ok, send your complete email address as your passwordPassword:230-230-Welcome, [email protected]
212.90230-Time is Sun Jun 12 17:53:54 2016 UTC230-230-This FTP server is for testing downloads and uploads on our network.230-You can download the files in the current directory. To upload,230-first cd to the ‘incoming’ directory. For more information, see:230-230-https://www.
talia.net/support/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=62230-230 Anonymous access granted, restrictions apply
Enter ‘dir’ to list the file on the remote site.
|ftp>dir200 PORT command successful150 Opening ASCII mode data connection for file list-rw-r–r– 1 ftp ftp 10485760 Dec 1 2015 10mb.pak-rw-r–r– 1 ftp ftp 1048576 Dec 1 2015 1mb.
pak-rw-r–r– 1 ftp ftp 5242880 Dec 1 2015 5mb.pakdrwxr-xr-x 2 ftp ftp 4096 Dec 1 2015 incoming-rw-r–r– 1 ftp ftp 321 Dec 1 2015 welcome.msg226 Transfer completeftp: 326 bytes received in 0.00Seconds 326000.00Kbytes/sec.
Now try to download a file using the ‘get’ command.
msg200 PORT command successful150 Opening ASCII mode data connection for welcome.msg (321 bytes)226 Transfer completeftp: 331 bytes received in 0.00Seconds 331000.
Try ‘cd incoming’ to change directories on the remote site.
|ftp>cd incoming250 CWD command successful|
Enter ‘dir’ to list the files in this folder.
|ftp>dir200 PORT command successful150 Opening ASCII mode data connection for file list-rw-r–r– 1 ftp ftp 3036409 Dec 1 2015 1_7297868604032095002_17-9ULspeedtest.
upt-rw-r–r– 1 ftp ftp 822373 Dec 1 2015 2_7297868604032095002_17-9ULspeedtest.upt-rw-r–r– 1 ftp ftp 859679 Dec 1 2015 3_7297868604032095002_17-9ULspeedtest.upt-rw-r–r– 1 ftp ftp 15 Dec 1 2015 file_1448960227480.
txt226 Transfer completeftp: 373 bytes received in 0.00Seconds 373.00Kbytes/sec.
Now try to upload a file using the ‘PUT’ command. This site does not grant anonymous users to upload files.
txt200 PORT command successful550 testftp.txt: Permission denied
When you are done, it is time to disconnect from the server. Enter ‘quit’ at the FTP command prompt.
Lesson SummaryNow that you have seen how to connect to and use an FTP server, you should be able to diagnose and correct your FTP connection issues. FTP tools come as part of most computer operating systems. 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, find the file you want to send or receive, transfer the file, and quit the program to close the connection.