Both Mac and Linux have built-in support for connecting securely to SFTP and SCP file shares. This is because both are closely connected to the Unix platform, where the ssh protocol was originally developed. Windows, however doesn’t have any such connection to these protocols. Luckily, there is a free program that will add the necessary functionality to easily work with these file shares. Its called WinSCP (http://winscp.net).
WinSCP (Which stands for Windows Secure Copy) is a lightweight program that allows Windows computers to connect to other servers running FTP or SSH (and thus securely to SFTP/SCP file shares) on them,
and I’ve even had success connecting to AFP (Apple Filing Protocol) shares (edit: since I wrote this article, I have done some additional research, and found out that the Mac servers that were using AFP also had SSH enabled for remote management, which is what WinSCP was probably connecting to — my recommendation is if you need to access files on a Mac from Windows, you probably need to also enable SSH on the server to make it work). In this tutorial, I’ll show you how to install this software and use it to connect to a server.
First thing to do is download WinSCP from its download page (http://winscp.net/eng/download.php). You’ll note that there are two different install packages available: the standard Installation package and the Portable Executable package. Use the Portable Executable package if you don’t have administrative permissions or if you want to install the program on a portable device like a USB drive. Otherwise use the Installation package to install the software onto a specific computer. After downloading the program, go ahead and run it.
Click Next on the Welcome window, and next again to accept the install license (WinSCP is distributed under the open source GPL license). The next window is the Setup Type window where you can choose to use the Typical Install option or do a Custom Install. For the sake of this tutorial, we’ll stick with the Typical Install option. Click Next to move to the next screen, select the Do Not Install radial button on the extra software window, and click next again.
The next screen lets you select the type of interface you want to use. The two options are the Commander and Explorer interfaces. The commander interface has a more traditional FTP program look with one frame on the left of the window showing your local files and another frame on the right showing the files on the server. You transfer files back and forth by dragging from one frame to the other. The explorer interface looks more like a typical Windows Explorer window of just the server’s files, and you transfer files back and forth by dragging them from one window to the other. Either interface will work, and you can switch back and forth after installation, so it really doesn’t matter which you choose (I happen to prefer the Commander interface myself). After selecting which interface you want, Click Next and then Install to complete the installation.
After its complete, click finish to close the install program. If you leave the Launch WinSCP box checked it will open the program automatically when you click finish. Otherwise you can use the desktop icon or Start Menu to run the program.
Setting Up a Connection in WinSCP
When you open WinSCP, you’ll see the main program screen. On the right hand side is a series of buttons that allow you to edit, delete, and create new connections. Left of that is a list of the connections that you’ve created and saved in the past. Click on the New button to open up the Login screen.
There are several fields on the Login screen that you should be aware of:
- Host Name: This is where you’ll put the name of the server that you want to connect to (for example: fs.finearts.utah.edu).
- Port Number: This is the port that the server will be connecting on. Unless otherwise instructed, just leave it set to its default number (port 22).
- Username: This is the username that you would use to log into the computer normally (for example: u0123456). If you are not sure what to use, ask the server’s administrator.
- Password: This is the password you would use to log into the computer normally (for example: password1234). Again, ask the server’s administrator if you don’t know what to use for this field.
- Private Key File: If your connection is set up to use Public/Private key authentication, you would tell WinSCP where your private key file is. If you don’t know what a private key is, or if you don’t have one, just leave the field blank.
- File Protocol: This is the type of protocol you’ll be using to connect with the server. Generally, you can leave this set to SFTP with the Allow SCP Fallback box checked.
Once you’ve filled in the appropriate fields, you can click the save button and choose a name for the connection (this can be whatever you want). If you want WinSCP to remember your password, go ahead and check the box that says Save Password (otherwise WinSCP will ask you for your password every time you try to connect). Finally click the OK button to save the connection to your Connections List.Walks through
Transferring Files Using WinSCP
Once you’ve created and saved a connection, you can access your file share by clicking on the entry in the list and clicking the Login button at the bottom of the window. This will open a box saying it’s attempting to connect to the server. If the information you entered is correct, it will open up a window showing the files on the server, and (if you selected the Commander Interface) the files on your local computer as well.
To enter a folder on either the server or local computer side, simply double-click on that folder. To move back out of the folder, you can double-click on the folder at the top of the list with an arrow and two dots (the two dots mean move up one directory). Finally, to copy a file from one computer to the other, simply click and drag from one side to the other. This will cause WinSCP to verify that you want to copy that file. Click Copy, and when the transfer is complete, you should see a copy of the file on both the server and local computer in the place you dragged and dropped it to. You can also copy folders and multiple files the same way (to copy multiple files or folders, simply highlight them all using the shift or ctrl key, then drag and drop). It’s important to remember that this action only makes a copy from one computer to the other. The original file will still be in the same place it was before the transfer. When you are done, you can simply close the window like you would any other, and it will close the connection for you and exit the program.
You should now be able to use WinSCP to upload and download files from other servers. There are several features available in WinSCP that we haven’t covered in this tutorial however. If you are interested in learning what these features are and how to use them, simply check out the WinSCP Documentation page at http://winscp.net/eng/docs/start. I’ve also created a video tutorial demonstrating these steps that can be seen on Vimeo, or by playing the the embedded video below: