From lubinski@Grinnell.EDU Sat Nov 18 13:43:32 2006 Date: Sat, 18 Nov 2006 13:43:32 -0600 From: "Lubinski, Christopher M" To: "Davis, Janet" Subject: Putty, etc. Please foreword this to the class. It's extremely useful, but is never taught to us. Thanks CM Lubinski You *can* log in to the mathLan from anywhere in the world and work on assignments, or, should you prefer, play Robots. I'll focus on Windows users as I know more about this field but I'll mention some Mac information towards the end. First, some background. The heart of Linux/Unix actually rests in the command-line interface visible in a terminal. All the GUIs, images, mouse information, etc. is all built on top of this command-line interface. This graphical information is provided by an amazing program called X, X11, or X.org. To run connect to the mathLan and run programs, all we *really* need is to connect to the command-line interface. If we do not receive the X information, however, we will not be able to use windows of any sort, which makes Dr. Scheme, Gedit, Robots, etc. quite difficult. Let's first focus on connecting with the command-line interface. You will need a program called PuTTy (links at the end) to allow you to use a protocol called ssh (secure shell) to connect to a mathLan computer. When you run Putty, you will be given an interface that allows you to define a host name/IP address. Here you should type in the fully qualified domain name of the computer you wish to connect to. For example if you want to connect to Hamilton, type hamilton.cs.grinnell.edu. If you prefer Taylor, type taylor.cs.grinnell.edu. You may also use ssh.cs.grinnell.edu, though this computer is a bit old and might not have the latest gcc installed. The other parameters generally default to acceptable values, but just to be sure, you should be using port 22 and the SSH protocol. Click "Open". You should now receive a message about a fingerprint or key. This is a security issue, but as we trust the mathLan, click accept. You will now be asked to log in. Ta da, you have a command line interface. You can use programs such as vi,emacs,nano,pico, etc. to edit c/scm/java/etc. files here and compile them with your compiler. As a quick note, please be aware that the character encoding may not be the same, resulting in rather odd characters appearing on your screen. We will fix that with the next section, X-Forwarding. So now we are connected to the mathLan, but we can't play robots just yet because we don't have X on our Windows computer. Let's fix that by getting an x-server to run on top of Windows. I prefer a program called Xming (links at the end), though there are several other good programs available. Once you have installed Xming, run the program. It will appear in the task bar (lower right corner of the screen) as a black X with a red oval-thing around it. Right-click this icon and go to "View Log". Notepad should open up with a huge block of text. Towards the end you should see a line resembling DISPLAY=127.0.0.1:0.0. This IP address is how the computer represents your X server; it shouldn't change unless you run multiple instances of Xming. Copy this number (127.0.0.1:0.0) and open Putty. On the left side, you should see an item called Connection. Expand this (click the plus sign to its left; if no plus sign, it is already expanded) and then select SSH. Expand this and click X11. Now, in the right portion of the window you should have an option for "Enable X11 Forwarding." Check this and then, in the "Display" text box, paste your display number (127.0.0.1:0.0). Though it should be the default, also select MIT authorization. Now, on the left side of the Window, select the first entry, "Session." Enter in the name of the mathlan computer you wish to connect to (e.g. lie.cs.grinnell.edu) and make sure the settings are as they were before. If you want to make this task simpler in the future, Putty offers an option that allows you to save this configuration. Type a name (e.g. "MathLan") in to the second text field and click "Save." In any event, click open and you will be logged in as before. Type xterm, gnome-terminal, or konsole to run the terminal you are familiar with. Miss your desktop? Type the command nautilus and you should see something familiar. Mac OS X users: Unfortunately, I do not how the X server works for Macs, though I know they exist. You *can* connect to the mathLan in text-mode pretty easily, however. Go to your desktop and click somewhere empty. You now should have the "Finder" program in focus. At the menu on the top, click Go > Utilities. In this folder, you will find a program called Terminal. This is more or less identical to the Unix command-line. In this terminal, type (excluding the quotes) "ssh user@hostname", where user is your username (e.g. lubinski) and hostname is the fully qualified computer name (e.g. bolyai.cs.grinnell.edu) and press enter. You now have access to all command-line tools. For a text editor, vi,emacs,pico work well. Do not use nano, as it does not understand the Mac keystroke, backspace, which is relatively important. If you manage to get the X server working well, you can X forward by typing the command "ssh -X user@hostname". Make sure the X is capitalized. I hope this is helpful. CM Lubinski Links: Putty http://www.chiark.greenend.org.uk/~sgtatham/putty/ Xming http://sourceforge.net/project/showfiles.php?group_id=156984&package_id=175377&release_id=460466 Mac OS X's X11 server: http://www.misplaced.net/fom/X11/ Wikipedia entries: http://en.wikipedia.org/wiki/X11 http://en.wikipedia.org/wiki/Ssh http://en.wikipedia.org/wiki/PuTTY http://en.wikipedia.org/wiki/Xming