ARCHIVED: Transfer files in Windows using an SSH or SFTP client

This content has been archived, and is no longer maintained by Indiana University. Information here may no longer be accurate, and links may no longer be available or reliable.

To transfer files to or from a server using SFTP, use an SSH or SFTP client. Following are two commonly used clients.

On this page:


WinSCP

  1. Open WinSCP. In the "Host name" field, enter the hostname of the server to which you are connecting (for example, bigred2.uits.iu.edu or carbonate.uits.indiana.edu).
  2. In the "User name" field, enter your username for the host you specified.
  3. In the "Password" field, type the password associated with the username you entered in the previous step.
  4. Click Login.
    Note:

    Two-factor authentication using Two-Step Login (Duo) is required for access to the login nodes on IU research supercomputers, and for SCP and SFTP file transfers to those systems. SSH public key authentication remains an option for researchers who submit the "SSH public key authentication to HPS systems" agreement, in which you agree to set a passphrase on your private key when you generate your key pair. If you have questions about how two-factor authentication may impact your workflows, contact the UITS Research Applications and Deep Learning team. For help, see Get started with Two-Step Login (Duo) at IU and Help for Two-Step Login (Duo).

When the software connects to your host, a window should appear with your local computer's directories on the left and the remote host's directories on the right. To move a file from your computer to the server, drag it from the left pane to the desired location in the right pane. To move a file from the server to your computer, drag it from the right pane to the desired location in the left pane.

PuTTY

Connect to a remote server

  1. To open the PSFTP part of the PuTTY application suite, from the Start menu, open PuTTY, and then PSFTP.
  2. With the PSFTP login window open, type open followed by the name of the host you are connecting to (for example, open karst.uits.iu.edu or open mercury.uits.indiana.edu).
  3. If the Store key in cache? prompt appears, type y.
  4. At the login prompt, enter your username for the remote server.
  5. At the password prompt, enter your password associated with the username you entered in the previous step.
    Note:

    Two-factor authentication using Two-Step Login (Duo) is required for access to the login nodes on IU research supercomputers, and for SCP and SFTP file transfers to those systems. SSH public key authentication remains an option for researchers who submit the "SSH public key authentication to HPS systems" agreement, in which you agree to set a passphrase on your private key when you generate your key pair. If you have questions about how two-factor authentication may impact your workflows, contact the UITS Research Applications and Deep Learning team. For help, see Get started with Two-Step Login (Duo) at IU and Help for Two-Step Login (Duo).

Exploring the file system

Once logged into the server, you will see the following command-line prompt:

psftp>

To move to a different directory, use the cd command. For example, cd documents will place you in the documents directory.

To display your current directory location, use the pwd command.

When exploring directories on your local computer, use the same commands, but add l (lowercase L) at the beginning (for example, lcd documents).

Display the contents of a directory

To display the contents of a directory on the server, enter dir or ls. To display the contents of a directory located on your computer, you must run a local command using !. In this case, you would enter !dir to display the contents of the current directory on your computer.

Note:
For a list of more commands, you can enter help, or see Use SFTP to transfer files.

Move a file from your computer to a server

  1. Navigate to the directory containing the file you wish to transfer.
  2. Navigate to the directory on your computer file system to which you want to transfer the file.
  3. To transfer the file, type put filename, replacing filename with the name of the file you wish to transfer.

Move a file from a server to your computer

  1. Navigate to the directory on your computer file system containing the file you wish to transfer.
  2. Navigate to the directory on the server file system to which you want to transfer the file.
  3. To transfer the file, type get filename, replacing filename with the name of the file you wish to transfer.

This is document akjs in the Knowledge Base.
Last modified on 2018-12-24 15:23:50.