Connecting To Server

Running Commands

You need to use the SSH technology to remotely connect to the servers.  Install the free Putty program on your computer, using the ‘Windows installer’ on this webpage:

http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

In the putty configuration window, type the server name in the ‘Host Name’ box.  There are two servers to choose from.  If you are not certain which to use, please ask Math/Stats Computer Support:

  • toronto.math.carleton.ca
  • ottawa.math.carleton.ca

Type the name in the ‘Host Name’ box, then click ‘open’ to connect to the Linux command-line on the server.

From the lab Linux computers, you do not need putty.  You just need to open a Terminal program and run ssh toronto, or ssh ottawa.

Transferring Files

Install the free WinSCP program, available here:

http://winscp.net/eng/download.php

Again, with this program you type the same server name into the ‘Host name’ box, then click ‘login’.

When you connect, WinSCP will show you all the files in your grad lab account.  You can upload or download them to your computer.

From the lab computers, you see the same files as on the server so you don’t need to transfer files!

Background Sessions

If you use the tmux command on the Linux command-line, then you are able to run multiple programs on the server, and you can also logout, and reconnect to your running program later.  This section contains information on using the tmux command.

Creating a new session

This command will start a new tmux session.  You will see a new Linux command line that is running inside tmux.  Each tmux session has a name, so you can have different sessions, and reference them by their unique names.

tmux new -s my_example01

Leaving (detaching) a session

This leaves a session, but it will keep running so you can resume the
session later. When you are in your tmux session, type:

Ctrl-b followed by d

Listing sessions

You can have more than one tmux session.  To see the list of running sessions, use this command

tmux list-sessions

Stopping (killing) a session

tmux kill-session -t my_example01

OR, type the Linux command exit inside your tmux session

Resuming (attaching) a session

tmux attach-session -t my_example01

Running MATLAB

You can run matlab interactively, however you will only see text.  You cannot see graphics, such as plots:

Type the Linux command matlab to start matlab

Then at the matlab command prompt, you can run your program using the command

run yourcode.m

and when you are done, you can exit matlab using the command

exit

Or, you can instead run your code directly from the Linux command-line, and you can even save the output results to a text file:

matlab -nojvm < yourcode.m > output.txt