FTP (File Transfer Protocol) has many graphical clients that can transfer files between a remote server and a local machine, but you can also use the command line via SSH (Secure Shell) to transfer files with FTP. To do this you need an SSH client. “PuTTY” is a free SSH client you could use or, if you use an Apple Mac computer, you can use its “Terminal” program as an SSH client.
- Skill level:
Other People Are Reading
Things you need
- An SSH client
- FTP login details for the remote server
Start an SSH session with your SSH client, login as necessary and change to the local directory you want to transfer files to or from. You can use the “cd” command to change directories at the command line.
Connect to the remote server with the “ftp hostname” command, replacing “hostname” with the hostname or IP address of the server you want to connect to. The “ftp hostname” command starts a normal, insecure FTP session and should be available on all platforms. If secure FTP has been set up, you can use “sftp hostname” instead or, if you are using PuTTY as your client, you can use the “psftp hostname” command. These are used the same way as standard FTP and they will encrypt your transfers to keep them secure, but the remote server must support these commands before you can use them.
Authorise your connection by entering the FTP username at the “Name” prompt and the FTP password at the “Password” prompt. This must be the username and password you wish to connect to on the remote server.
Put a file on the remote server with the “put filename” command, replacing “filename” with the name of the local file you want to send to the remote server. This will transfer the file from the machine you are on to the remote server.
Get a file from the remote server with the “get filename” command, replacing “filename” with the name of the remote file you want to fetch. This will transfer the file from the remote server to the machine you are on.
Close the FTP session by typing the “exit” command.
Tips and warnings
- With both “put” and “get” you can tell FTP to save the file as a different name by using the “put filename newname” command or the “get filename newname” command. You can also use directory names, such as the “put myfile.txt public_html/otherfile.txt” command.
- Type “help” in your FTP session to get a list of all commands you can use.
- Always take care when using the command line. It is very powerful and simple commands can cause a lot of damage, often without any confirmation.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for