Using WinSCP: The Basics

WinSCP enables you to transfer files safely and securely to and from your Windows computer and the CUNIX server. WinSCP works seamlessly with Windows Explorer and your desktop.

WinSCP also enables you to manage your files and change file properties. You can also view and edit files using either WinSCP's text file editor or another editor such as Notepad.

What Is Secure FTP?

Secure FTP (File Transfer Protocol) provides a safe and secure (encrypted) connection for transferring files between your computer and the CUNIX server. This secure connection reduces the chance that malicious persons will be able to steal your password and use it to compromise the Columbia University network.

WinSCP Interface Types

WinSCP contains two types of interfaces: the Norton Commander interface (default) and the Explorer-like interface. Each interface provides slightly different methods of transferring files to CUNIX, but both enable you to transfer with the "drag and drop" method. WinSCP enables you to transfer files directly from Windows Explorer or your desktop.

Although it uses the Norton Commander as the default interface, you can change the interface at any time.

Below are descriptions and comparisons of each interface.

Norton Commander Interface

The Norton Commander interface is divided into two sections—the Local Panel and the Remote Panel. The Local Panel, located on the left, contains the files and directories on your local computer; the Remote Panel, on the right, contains your files and directories on CUNIX.

Just above the title bar of each panel, you will see a set of icons that enable you to work with directories. You will also see a drop-down list that enables you to navigate to other drives or directories, depending on which panel you're using. You can access a different drive or directory by selecting the desired drive or directory from the drop-down menu.

Note: See Working With Files and Directories below.

Explorer-Like Interface

The Explorer-like interface has only one panel, which contains files and directories for the remote host—in this case, CUNIX—and whose interface is similar in look and feel to Windows Explorer. Using the Explorer-like interface, you transfer files to CUNIX using the "drag and drop" method either from Windows Explorer or from your Desktop.

WinSCP Interface Types Compared

Note: Unless otherwise noted, the procedures in this guide apply to the Norton Commander Interface.

  1. Select Preferences from the Options menu or click the Preferences icon
  2. Click the Interface link.
  3. Select the desired interface by clicking its radio button.
  4. Click OK.
  5. Close and then re-open WinSCP for the change to take effect.

Notes: You can always switch interfaces at any time. If you're switching to the Norton Commander interface, select the option Explorer style selection from the Commander category in the Preferences window.

Working With Files and Directories

Switching Between Directories

There are a number of ways you can navigate from one directory to another:

You can also move quickly between directories by bookmarking directories you use regularly.

  1. Click the Open Directory icon in the toolbar at the top of the local and remote host title bars.
  2. In the Open directory window, type the full path of the directory you want to open, or click the button to locate the directory you want to open.
  3. Select the directory you want to open in the Browse for Folder window. To drill down into a directory, double-click that directory name. To select a directory, click once on the directory name to highlight it. The path of the directory you selected will be displayed in the Open directory window.
  4. Click OK. The new directory will be opened.

Bookmarking a Directory

You can save (bookmark) any directory you need to access regularly. This works the same as bookmarking a URL. Bookmarking a directory makes it easier and quicker to access directories you use often.

  1. Click the Open Directory icon in the toolbar at the top of the local and remote host title bars.
  2. In the Open directory window, type the full path of the directory you want to open, or click the button to locate the directory you want to open.
  3. Select the directory you want to open in the Browse for Folder window. To see the contents of a directory, double-click that directory name. To select a directory, click once on the directory name to highlight it. The path of the directory you selected will be displayed in the Open directory window.
  4. Click Add. The directory path will be displayed in the Bookmarks area.
  5. Click OK.

Renaming Files and Directories

  1. In the Local or Remote panel, open the directory where the item you want to rename is located.
  2. Select the file you want to rename by selecting Rename from the Files menu, or by right-clicking on the file and then selecting Rename.
  3. Enter the new name, and then click the mouse anywhere outside the text field.

Notes: You won't be able to rename a directory if:

  • The directory is currently bookmarked
  • The directory or file is currently open
  • Any files or subdirectories in the directory you want to rename are currently open
  • If another instance of the file or directory exists on either the local or remote host, you may want to consider renaming that copy as well in order to avoid any possible confusion.

Opening a Bookmarked Directory

You can easily access any directory you've bookmarked.

  1. Click the Open Directory icon in the toolbar at the top of the local and remote host title bars.
  2. Select the bookmarked directory you want to open and then click OK.

Deleting Files and Directories

  1. In the source panel, open the directory where the item(s) you want to delete are located.
  2. Select Delete from the Files menu or or press F8.
  3. Click OK in the Confirm pop-up window to delete the items, or click Cancel if you decide you don't want to delete the item(s).

Note: Any files and directories you delete on your local computer will be moved to your Recycle Bin, retrievable until it is emptied. However, any items you delete on CUNIX will be removed permanently.

Transferring Files and Directories

WinSCP enables you to copy or move files and directories to and from your Windows computer and CUNIX.  However, you should NOT move your "mbox" file, your CUNIX inbox.  If you do, you won't see see your inbox at all when you open your mail.

  1. In the destination panel, open the directory to which you want to transfer the file(s) or directories.
  2. In the source panel, open the directory where the file(s) or directories you want to transfer reside.
  3. Select the files or directories you want to transfer:
    • To select multiple files or directories, click on each file or folder while holding down the Ctrl key.
    • To select a single file or directory, click on that file or directory once so that it is highlighted.
  4. Click and drag the selected items to the destination. (If you are using the Explorer-like interface, drag the items either to your Desktop or to the desired directory in your Windows Explorer.) The Copy window is displayed.

    To display the current default file transfer permissions (as shown below), click the More button.
     
  5. Click Copy. If an older version of any of the items you're transferring already exists in the destination directory, a confirmation pop-up window will be displayed. Click Yes to continue, or click No to cancel.

Note: WinSCP assigns default permissions to all files you transfer to CUNIX. However, you can change the permissions at any time.

Working with Sessions

A session is a permanent profile of your login session that contains many settings unique to that session. Among the settings you can save in a session are login information, file and directory permissions and other transfer settings, bookmarked directories, and interface settings.

Saving a Session

You can create multiple sessions. This can be very helpful if you want to transfer files to and from different directories and don't want to have to constantly switch between directories. By simply moving from one session to another, you'll be able to quickly and easily "switch" between directories.

For example, you may need to transfer files that reside on multiple locations on your local computer to your public_html directory on CUNIX.

  1. Select Save Session from the Session menu or click the Save session icon.
  2. In the Save session as pop-up window, click OK to save the session.

    If the session you're saving, such as cunix.cc.columbia.edu, has been previously saved, you will be prompted whether you want to overwrite the existing session. Click Yes to proceed, or click No to cancel. If you saved the session, the WinSCP Login window will again be displayed, and the name of your newly created session will be displayed.

Opening a Saved Session

WinSCP enables you to log into any additional sessions you've saved.

  1. Select from the Open saved session drop-down list the session you want to open.
  2. Enter your password and then click OK.

If you have multiple sessions open, you can easily switch from one session to another.

To switch sessions, select the session you want to switch to from the drop-down list.

You can log out of WinSCP one session at a time or close all your sessions and exit the application at once.

You can close any session while still remaining logged into your other sessions.

  1. Switch to the session you want to close.
  2. Click the Close session icon. If you were logged into more than one session, WinSCP automatically switches to one of your other active sessions.

 

Reconnecting to an Expired Session

If you have been logged in to a session for a long time, WinSCP may log you out automatically for security reasons. You will then need to log in again. However, you will still be logged in to any other currently open sessions.

  1. Click Reconnect in the error message displayed.
     
  2. Enter your password and then click OK.

WinSCP for Web Publishing

The next two sections cover features especially relevant to web developers:

  • Managing File Permissions to make your website publicly visible and to enable sharing file access within your group. 

    Since secure file transfer will NOT work with the hosts www.columbia.edu and wwwgrp.columbia.edu that set file permissions automatically, you must set the permissions of each file at transfer time or afterwards.
  • Setting Default Directories to make uploading to and from the same place easier.

If you have not set up a web page at Columbia yet, see Creating Web Pages at Columbia

Managing File Permissions


What are Permissions?

Each file and directory you transfer from your local computer to CUNIX is automatically assigned permissions, or levels of access. Although WinSCP sets file permissions to each file you transfer, you can set the permissions of individual files either at the time you're transferring a file or after you've already transferred a file.

Levels of access can be set distinctly for the Owner of the file, the file's Group, and all Others. Each demographic can be granted Read, Write, and/or eXecute permissions. Someone must have the eXecute access level to a directory for any kind of access to the files inside it. However, if you change a directory's permissions, the specific permissions of the files in that directory will remain the same.

While uploading files, if you click the More >> button in the Copy window, you can set the permissions of the files being uploaded. However, once the files are uploaded you may need to change a file's permissions or the unix group for sharing between web developers. WinSCP supports two protocols and uses SFTP by default. Only the second protocol, SCP (secure copy), allows you to change the group of remote files. The WinSCP site contains additional information about the two protocols.


To change protocols, open WinSCP and from the Login window highlight cunix.cc.columbia.edu and then click the Load button on the right. From there choose SCP under Protocols. To keep this setting, click Save... and follow the prompts before logging in.

Change the permissions and Group with SCP

  1. Right-click the file name and choose Properties from the context menu.
  2. Here you can set the group and, more importantly, set the permissions. For files to be visible from the web, the Others row must have the checked. Directories must have the checked--you can check 'Add X to directories' instead, of course. For file sharing, make sure the Group: is set correctly and the W is checked in the Group row.
  3. Click OK.

Setting Default Permissions

Any permission changes you make before you transfer files will apply to each file you transfer in that session. So, for example, if you're working in a session called "My Session", any file you transfer in that session will be assigned the updated permissions. To make your changes permanent, be sure you've saved your session.

  1. Beginning at the Login window when you start WinSCP, click the Preferences option on the left, and then click the Preferences button from the frame on the right. If you are already logged in, select Preferences from the Options menu, or click the Preferences ()icon.
  2. Select the Transfer option on the left.
  3. Select edit.
  4. In the Transfer settings window, check Set permissions in the Upload options section.
  5. Change the file permissions for Owner, Group, and Others as desired by clicking the appropriate R (Read), W (Write), and/or X (Execute) check boxes. 

    Notes:
    • If you primarily transfer private files uncheck the R in the Others row.
    • If you are maintaining an official site, check the W in the Group row
  6. Click OK.

Setting Default Directories

If you always upload and download to and from the same directories, you can configure WinSCP to start your session in the same Remote and/or Local directories.

  1. Beginning at the Login window when you start WinSCP, highlight your session, for example, cunix.cc.columbia.edu and click the Load button on the right.
  2. Click the Directories option under Environment on the left.
  3. Enter the Remote directory field. Web publishers, enter the directory your web site resides; either "/www/data/something/something" or "public_html" for your personal web site.
  4. Click the button on the right of the Local directory field and select the directory where you want to begin. Web publishers should select the directory on your computer where you store the site's web files. 
  5. After choosing a Local directory, click Save and follow the prompts.

Setting Preferences

Click the Preferences icon on the toolbar to display the configuration options as shown below. Among the options available are document transfer preferences, permission preferences, and interface preferences. Just click a category on the left to display its associated options.