Working Remotely

You can access the CSE system remotely by logging into the server Adriatic (adriatic.cse.msu.edu) via SSH ("secure shell"). SSH itself is just a protocol -- an SSH client uses this protocol to access a computer running an SSH server.

See the CSE 232 System Hints for some basic info on using SSH. The remainder of this page provides more detailed info.

SSH Terminal Clients for Linux and Mac

Most Linux computers (including the CSE worksations), as well as MacOS X, have a command-line SSH client installed. Use the following command to log in to the remote computer:

$ ssh (username@)address

Notes:

SSH Clients for Windows

Some SSH clients for Windows include:

SSHWin is the simple solution, though I don't like it much. It's main advantage is the ability to open multiple sessions without typing in your password more than once. Unfortunately, the default background is white (which can be painful to look at for long periods of time), and I have not been able to configure colored text to be readable on a black background using this program.

PuTTY and Xshell both have a dark background by default, which makes them much more visually appealing. They are both solid and highly configurable, though there are some disadvantages to each.

PuTTY

Some disadvantages:

  1. PuTTY absolutely will not save your password. In theory, this is a security measure, but in practice, it's annoying. In order to open multiple windows, you must open the program and log in multiple times.
  2. There's no easy way to change default settings for all sessions (each new remote computer you add will inherit the default settings at that time, which you can then modify). Fortunately, this is not much of a problem for this class, since you only need to be able to log in to Adriatic.

Configuration hints:

  1. Use "USERNAME@adriatic.cse.msu.edu" as the computer name and save a profile to avoid having to type in your username every time.
  2. The default blue colors are too dark. You make them lighter by increasing the RGB green values under Settings -> Windows -> Colors.
  3. See this page for more configuration recommendations: http://dag.wieers.com/blog/improving-putty-settings-on-windows.

Other notes:

  1. By default, you simply select text to copy, and right click to paste. To get the menu, right click on the top of the window.

Xshell

I have not used Xshell as long as PuTTY, but it lacks PuTTY's main disadvantages. It can also open sessions in multiple tabs, which can be useful.

The main weirdness about Xshell is its awful default shortcuts for copy and past, which fortunately can be fixed.

  1. Go to Tools -> Options -> Keyboard and Mouse -> Key Mapping -> Edit
  2. Use the "New" button to create shortcuts.
    1. Use ctrl-shift-c and ctrl-shift-v to avoid messing up the normal Linux meanings of ctrl-c and ctrl-v.
    2. Choose "Menu" for the functions, then copy/paste.
Alternatively, consider enabling copy on selection and past on right click, which is how PuTTY works by default.

Running Graphical Linux Programs Remotely

In order to run graphical linux programs on a remote computer, you will need to install an X11 server on your local machine (X11 is the most basic component of any graphical Linux system).

Using Xming on Windows

Setup

  1. Install Xming <http://sourceforge.net/projects/xming>.
  2. Enable X11 tunneling.
    1. In SSH: Edit -> Settings -> Profile Settings -> Connections -> Tunneling -> Tunnel X11 connections
    2. In PuTTY: Connection -> SSH -> X11 -> Enable X11 forwarding
  3. Save your settings so that you don't have to do this every time.

Every time you log in

  1. Start Xming (Not XLaunch). It's a background program with a tray icon.
  2. Log in to Adriatic.
  3. Type the command line name of the program you want to use (usually all lowercase), followed by any options and arguments, ending with an ampersand (&). This creates a new process for the program, and allows you to continue to use the terminal even while the program is running.

Coding on Windows/Mac

We do not recommend you write and store your code on your own computer, but there are reasons for which you might want to use an editor running on Windows or Mac instead of on Adriatic remotely while storing and running your code on the CSE system. For example, when the connection is poor, there can be significant lag running even a text-based editor remotely.

I have two solutions for you. The first is cross-platform, and the second is Windows-specific.

Note that you should not compile and test your code on your own computer, because you will be graded based on how it executes on Adriatic, and only the CSE lab workstations are similar enough that you can safely assume that there will be no differences.

FileZilla (Windows/Mac)

You can use the FTP/SFTP client FileZilla, which is available for Windows, Mac, and Linux, to create, open, and edit your files, and use your SSH client only for compiling and running code.

  1. Create a profile for logging into Adriatic as in an SSH client.
  2. Choose SFTP as the protocol and "Normal" as the authentication method.
  3. Navigate to your project folder. Right click on the file, and choose "View/Edit". It should open in your default program for that file type.
  4. Edit and save your file, then click inside the FileZilla window and upload the file. Now you can compile and execute your code in your SSH client.

On Windows, the default program will almost certainly be the useless Notepad, which is not compatible with Linux files, so you will need to install a real editor, such as Notepad++. Open it, go to Edit -> EOL Conversion, and choose "Unix Format".

Mac is a Unix system, so you don't have to worry about the EOL type. You may still want to use a different editor from the default though.

With either OS, you have several choices for setting your new editor:

  1. Make your new editor the system default editor for .cpp and .h files.
  2. Set FileZilla's filetype associations under Edit -> Settings -> FileEditing -> Filetype Associations.
  3. Tell FileZilla to use a custom editor for all files under Edit -> Settings -> FileEditing.

Notepad++ and NppFTP (Windows Only)

Notepad++ also has a built-in FTP client, allowing you to open files from your CSE account directly (without the extra steps of downloading and uploading in FileZilla).

  1. Go to Plugins -> NppFTP -> Show NppFTP Window.
  2. Create a profile as in FileZilla.
  3. Open from the sidebar.
  4. Edit and save as with any other file.
  5. Use your SSH client to compile and run.

Note that you will still need to set the EOL type correctly: go to Edit -> EOL Conversion, and choose "Unix Format".


Last updated 1/29/13