Filed under: Technical References
Posted: March 7, 2009
Like SSH, one may use Secure Copy (SCP) in order to remotely connect to a computer. The major difference between SSH and SCP is that while SSH allows a user to manipulate a computer through a terminal, SCP allows a user to transfer files to and from said computer. All CS students may transfer files to and from their computer and their home directory in this fashion.
For the purposes of this Howto, we will be refering to london.cs.uri.edu as the target server (the one you will be connecting to).
For Windows Users: WinSCP
Like SSH, a user must have an SCP client in order to make transfers using SCP. If you are running Windows, we recommend using WinSCP. You may download it from here.
After running the WinSCP executable, a login window will appear (Figure 1.1). Ensure that port 22 is selected, and in the Host name input box type london.cs.uri.edu. Likewise, insert your username into the User name input box (we used jdoe in the example) and insert your password.
Go ahead and click “Login”. After you have logged in, you will be presented with two sets of files and folders on the right and on the left: your local computer and the remote computer, respectively (Figure 1.2). To make file transfers, click and drag a file either window to the other. When you are about to make a transfer, a dialog box will appear. You may click “Copy” to execute the transfer.
For Linux Users: SCP
Linux users may do the same thing as above through the command prompt. Let’s assume that we are logged in on any *nix machine (even MacOS X). We have a file called “foo.txt” that we want to transfer to our home directory on london. Through the scp command, we can send this file to london:
auser@somemachine ~ $ ls foo.txt foo.txt auser@somemachine ~ $ scp foo.txt yourcsusername@london.cs.uri.edu:foo.txt
You will be prompted for your password. Remember that you will not see any asterisks or characters when you type your password.
Assuming that the file transfers properly, you should see something like this:
foo.txt 100% 0 0.0KB/s 00:00
If you wanted to transfer the entirety of a folder, you could use the -r flag at the end of scp. Example:
auser@somemachine ~ $ scp -r ~/path/to/directory/ yourcsusername@london:path/to/directory/
It is worth noting that scp works pretty much identically to cp.
For MacOS X Users: CyberDuck
While the Linux instructions will also work (Mac OS X has scp, available through Applications:Utilities:Terminal), there is a nice graphical interface called Cyberduck.
