CS367: Introduction to Data Structures
Using SCP/SSH to connect to CS Computers - Lecs 1 & 2, Spring 2012


Note: this information was written with Mac users in mind, however, users of other platforms may also find it useful.

Copying to/from Your Computer and a CS Lab Computer

Use secure copy:

scp <source_of_file_to_be_copied> <destination_folder> Example: scp Desktop/H1.txt bbadger@best-linux.cs.wisc.edu:/u/b/b/bbadger/private/ (Note: if your computer will not allow you to connect to best-linux.cs.wisc.edu, try connecting to best-mumble.cs.wisc.edu or best-king.cs.wisc.edu; if that doesn't work, try connecting to mumble-NN.cs.wisc.edu where NN is a 2 digit number between 01 and 40.)

The first argument (<source_of_file_to_be_copied>) is where your file is currently located on your computer. The second argument (<destination_folder>) is the destination and should be an existing folder. In the example above, the file "H1.txt" is being copied from the desktop of a personal computer to the private CS directory of a person with the CS login "bbadger".  The general format for getting to your personal CS directory is /u/<first_letter_of_CS_login>/<second_letter_of_CS_login>/<CS_login>/

Note the slash (/) at end is important so that the source file is copied into the destination folder (as a file with the same name as the file on your computer) and not copied as a file with a new name (into a folder you don't intend it to go).

Remotely Connecting to a CS Lab Computer

  1. Go to the Terminal and enter:

    ssh <username>@best-linux.cs.wisc.edu

    where <username> is replaced with your CS login name.

    Note: if your computer will not allow you to connect to best-linux.cs.wisc.edu, try connecting to best-mumble.cs.wisc.edu or best-king.cs.wisc.edu; if that doesn't work, try connecting to mumble-NN.cs.wisc.edu where NN is a 2 digit number between 01 and 40.

  2. You may be prompted about something, just type in yes to add as a default.

  3. You will be prompted for your CS account password. (Your password will not show up as you type it.) Press enter and you are logged in.

  4. To logout, just type in "logout" on the command line.

Testing Your Program Remotely on a CS Lab Computer

  1. From the Terminal: go into the directory with your source file(s)

  2. To compile your program:
      Enter: javac <filename.java>     Example: javac P1.java
      This will create <filename>.class     Example: P1.class

  3. To run your program:
      Enter: java <filename> Example: java P1
      If your program takes command-line arguments add them after the main class.
      Example: java P1 CLarg1 CLarg2

Last Updated: 1/19/2012     ©2012 Beck Hasti