How to transfer files via SSH access

Written by gordon ansell Google
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to transfer files via SSH access
FTP can be used via SSH to transfer files (Jupiterimages/ Images)

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

Show MoreHide


  1. 1

    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.

  2. 2

    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.

  3. 3

    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.

  4. 4

    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.

  5. 5

    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.

  6. 6

    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.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.