WinSCP Tutorial
01/28/09: Y. Liow ([email protected])
What is WinSCP?
“WinSCP is an open source SFTP client for Windows. Its main function is the secure file transfer between a local and a remote computer. Beyond this, WinSCP offers basic file manager functionality. It uses Secure Shell (SSH) and supports, in addition to Secure FTP, also legacy SCP protocol.” (from http://winscp.net”)
Installation
If you’re comfortable with installing software, this is all you need: google for winscp and install the latest stable version of WinSCP. For this tutorial the version is 4.1.8. Again you should install the latest stable version. Otherwise please read on.
First we will download the installation program. Open your web browser and point it to http://winscp.net. For this tutorial, I’m using the Firefox browser. Look for this (again, for this tutorial the version is 4.1.8 – you should look for the latest stable version to download and install):
and click on the “Download”. On the next web page, look for “WinSCP 4.1.8” and click on “Installation package”:
The next thing to do is to run the installation program to install WinSCP. Double-click on the above icon to begin installing WinSCP and you will see this:
Click on “OK”. Click on “Next >” a couple of times and then “Install”. Then your installation is completed, click on “Finish”. You should see these on your Desktop:
You can delete “winscp418s...”, i.e., the installation program. To run WinSCP, you double-click on the “WinSCP” icon.
Logging In
Now we will login to a server. Run WinSCP and you will see this:
Click on Preferences on the left
Fill in “Host name”, “User name” and “Password”. This will be provided by your instructor. Unless otherwise stated the “Host name” is “gandalf.ccis.edu” (without the double-quotes). I will be using the user “yliow”. Do not change other options.
Do not click on “Save...” if you're using a public machine as that will save your password onto the machine. Click on “Login” and you will see something like this:
You are now logged in to the server. My home directory on the server is “/home/yliow”. If you are user “jdoe”, your home directory is “/home/jdoe”. What you see above are the files in my account on the machine
Navigation
The left window pane shows the files on your local machine (i.e. the machine you're working on) while the right pane shows your files in your home directory on the server.
On the left window pane, you will see your folder “My Documents”. Navigating the file system using the GUI of WinSCP is very similar to for instance the Windows Explorer of Windows XP. I will only mention a few points here.
Of course you can go into a different folder by clicking on the folder. You can also go to the parent folder
You can also pull down the following to go to your “Desktop”, etc.:
Note that in the above picture, the right pane is selected (because /home/yliow is highlighted):
To select the left pane simply click on any area of the left pane. To select the right pane simply click on any area of the right pane.
You can maximize the window to see more buttons. Double-click on
folder to go into the folder.
Click to go to the parent folder
Manage Files and Folders on the Server
Just like on your personal Windows machine, you can create and delete files and folders. (Except that on a UNIX system “folders” are called “directories”.) The GUI of WinSCP is very similar to the GUI of Windows XP.
Instead of explaining every feature of the GUI of WinSCP, I will do a demo on how to create the “ciss240” directory in your home directory at the server, go into the directory to view the contents, go back to your home directory, and then remove the “ciss240” directory.
First select the right pane. Next either press F7 or click on “F7 Create Directory”:
You will be prompted for the name of your directory. Enter “ciss240”:
You have just created a “ciss240” directory in your home directory. If you double-click on “ciss240” you will see the contents of this folder:
You can go back to your home directory by click on “yliow”:
To delete the “ciss240” directory, you can either right click on “ciss240”
and then click on “Delete” or you can right click on “ciss240” and press F8.
Exercise. Create the “ciss240” directory in your home directory again. Go into “ciss240” and create a directory
called “a01”. This will be used in the next section.
Transferring Files
Transferring a file between your local machine and the server is just a matter of dragging and dropping the file between the left and right pane. But before you do that you should set some default permissions. From the main window, select “Preferences” on the left:
Click on the “...” button just below “Set permission” and make sure you check or uncheck the options in the popup window:
Now we are ready to do some file transfer. The following steps will transfer a file called “test.txt” from the local machine to the server at the directory /home/yliow/ciss240/a01.
First suppose you have a file called “test.txt” in your “Desktop”. First make sure you can see your “Desktop” on the left pane. Next make sure you can see the /home/yliow/ciss240/a01 directory on the right pane:
You have just made a copy of “test.txt” (in your “Desktop” folder) from your local machine to the server (in ciss240/a01 from your home directory.).
Exercise. Transferring a file from the server to your local machine is just as easy. Remove “test.txt” from your
Organization of Your Class Work
The following instructions are specific to the classes taught by Dr Liow. In the following I assume that you're a student in CISS240.
• In your home directory at gandalf.ccis.edu, you must have a ciss240 directory. • In the ciss240 directory you must have an a directory for storing all the assignments. • In the a directory you have directories for each assignment a01, a02, a03, etc.
• Suppose that for assignment a01, there are two questions. In that case in directory a01 you have two directories a01q01 and a01q02.
• Suppose that for question 1 of a01, you have to write a C++ program with source file name
a01q01.cpp. The file a01q01.cpp must be stored in directory a01q01. Likewise if a01q02.cpp is the program for question 2, then a02q02.cpp must be stored in directory a01q02.
The directory structure starting at your home directory (assuming your login name is jdoe) looks like this: jdoe | +---ciss240 | +--- a | +--- a01 | +--- a01q01 | | | +--- a01q01.cpp | +--- a01q02 | +--- a01q02.cpp
Modifying the Environment
For your personal machine, you can make the following modifications.
Note that when you login to the server, the default folder shown for the local machine is the “My Documents” folder and the default directory shown for the server is your home directory. The following will change the default local directory to “Desktop” and the default directory on the server to “ciss240”.
First close the WinSCP program and start it again. You will see this:
Click on “Directories” and you see this:
Enter “ciss240” (without quotes) in “Remote directory” and click on “...” for “Local directory” and select the “Desktop”:
When you click on “Save” you will be prompted for a name for the session. Enter “ciss240” and press “OK” and you will see this:
If you double-click on the above “ciss240” and login, you will see that the left pane is your “Desktop” and the right pane is the “ciss240” folder in your home directory.
Although you can save your password into the “ciss240”, for security reason, you should not do so, even for your personal machine.
Exercise. Modify the “ciss240” session by adding the server name and your user name to it. Do NOT add your
Important Note
You should know that all Columbia College policies apply to our department servers. In particular you should only use the server for work related to your classes. If in doubt, you should always consult with the instructor. Violation of policies will result in suspension of your account for a period of time determined by the Computer Science faculty.