Computer lab introduction
"On the other side of the screen, it all looks so easy." (TRON, 1982)
- 1 Goals
- 2 WiFi Login
- 3 Downloads
- 4 Remote computer access software
- 5 SSH
- 6 Intro-to-Unix tutorial
- 7 Setting up Cyberduck
- 8 Short Cyber Duck Exercise
- 9 SCP is a good alternative to Cyberduck for linux and Mac's
- 10 Accessing the cluster from outside MBL
- 11 Useful links
By the end of this introduction, you should be able to:
- Log in to the class cluster.
- Navigate and understand the directory structure.
- Create and edit files and directories on the cluster.
- Move files to the cluster.
Ask for help if any of these things aren't working by the end!
To log on to the MBL wireless choose the MBL-REGISTER from the wireless list. Your username is your initials followed by the 5 digit number on the side of your identification card. Your password is the same. E.g. if your name is Jane Bloggs and the your card has the number 12345 on the side then your login details are:
Some people have been having trouble, if it isn't working find or email Emily Jane firstname.lastname@example.org
Please download and install the following programs:
After you have installed Notepad++, open it. Go to Settings, Preferences, New Document, and set the line endings to Unix.
- Mac Os X
If you have time at the end of this lab, please use it to download the software listed here: Divergence time software
Remote computer access software
We will use Secure Shell (SSH) and sFTP to connect to the servers. The servers are powerful computers where we can run the programs much faster than would be possible on your laptop. In order to access these you need to log in to your assigned server
SSH stands for "Secure Shell." These are programs that provide a Unix shell so that one can enter commands and log onto other computers (i.e., those on the server where we will be doing our analyses).
You must be on the MBL register internet or this will not work
SSH on Linux and Mac Os X
First, open a terminal window:
- Linux: Konsole (KDE), gnome-terminal (GNOME)
- Mac: Terminal (in /Applications/Utilities)
First we want to log on to the class servers.
In the following command replace username and servername with the user and server name found on the back of your name tag:
For example if my username is jbloggs and my server name is class04 I type:
It will then ask for your password which is on the back of your card under your username
SSH on Windows
Use PuTTY. To set up SSH on PuTTY Enter your username and servername in the "Host Name or IP Address" field You can find your username and servername on the back of your name tag:
For example if my username is jbloggs and my server name is class02 I type:
Enter a name for this configuration (e.g. MolEvol) where it says "Saved Sessions" and click Save Now you can access the cluster by clicking on that saved session.
PuTTy copy paste tip: PuTTy FAQ
Copy and paste works similarly to the X Window System. You use the left mouse button to select text in the PuTTY window. The act of selection automatically copies the text to the clipboard: there is no need to press Ctrl-Ins or Ctrl-C or anything else. In fact, pressing Ctrl-C will send a Ctrl-C character to the other end of your connection (just like it does the rest of the time), which may have unpleasant effects. The only thing you need to do, to copy text to the clipboard, is to select it.
To paste the clipboard contents into a PuTTY window, by default you click the right mouse button. If you have a three-button mouse and are used to X applications, you can configure pasting to be done by the middle button instead, but this is not the default because most Windows users don't have a middle button at all.
You can also paste by pressing Shift-Ins.
You should have a black screen asking for your password, which is on the back of your card under your username. Type it in. You will not see the letters you are typing.
Changing your password
The first thing to do once you have successfully logged on to a server is to change your password. This is done by typing:
This will prompt you to enter a new password so do so and press the enter key. Next you re-enter the new password and again press enter. It may then ask you for your LDAP password and you should type in your original password given on the back of your card.
Once you have done this every time you ssh in to the server you will use the new password created.
Unix commands follow the general format of:
command -options target
Not all commands need options (sometimes called flags, and generally preceded by a single or double hyphen ("-" or "--")) or targets, but others require them.
- For example:
- cd homedirectory uses the command "cd" (change directory) and the target "homedirectory" to move from the current directory into the subdirectory called "homedirectory"
- ls -l homedirectory uses the command "ls" (list), the option "-l" for long-list, and the target "homedirectory" to list the contents of homedirectory in the "long list" format, which provides more thorough descriptions than does the regular "ls".
Notes on syntax for directory structure
- Two dots (..) indicates the parent directory of the present working directory. So, for example, "cd .. will move you back one directory.
- One dot (.) indicates the present working directory. So, for example, "cd ." will keep you where you are. There are times where the single dot can be more useful than this...
- The tilde (~) refers to your home directory. On the class machines your home directory is /class/yourusername. You'll also have a unique home directory on your laptop, etc. The tilde is very helpful if you get lost while using the terminal -- just type "cd ~" and you'll be back in your homedirectory.
- A forward slash (/) by itself or at the start of a path refers to the root of the filing system -- the folder that contains all other folders.
- NOTE: do not make changes on the class server in the root folder or any shared folders. All your work is to be done in your home directory or a subdirectory.
Please go to the UNIX tutorial and go through the step by step guide there.
Setting up Cyberduck
Creating a bookmark
When you open Cyberduck a screen should appear that has some default connections bookmarked such as Google Docs and Amazon.
Click the '+' button at the BOTTOM LEFT to create a new bookmark (NOT the one with the globe at the top). Here we will put the details of our cluster login and save it so that each time we open Cyberduck we don't have to re-enter the details. Click the dropdown menu that says FTP (file Transfer Protocol) and select SFTP.
Create a nickname for this bookmark. For example mine is called 'MBL cluster'.
In 'server' write the class number of the server you were given. For example, I am emctavish@class04 so I put class04 in here.
In the username box place the username you were given. This is likely your first initial and your last name. For example mine is emctavish.
Once all these details are entered close that screen. (e.g. on a mac click the red circle or on windows click the X).
A new bookmark should have appeared named whatever you set as the nickname. Double click on this.
Cyberduck should ask you for the password. Type in the password you changed it to earlier. There should be a button asking for you to 'add to your keychain' or something similar. Make sure this box is ticked. Once done, click to connect.
This may connect you directly to the cluster. If not double click on the bookmark again.
You now should see your home directory on the cluster. You should see the file "yourname.txt" that we created earlier.
Navigating through the class cluster in cyberduck is easy.
Double click on a folder to open that folder.
Above the window that lists files there should be your path. For example when I login my path shows '/class/emctavish'. This tells me where I am on the cluster right now. If you click this dropdown menu you can see each folder you are in. For example when I click on the dropdown I have a line that says /class/emctavish, one that says /class and one that just says /. Clicking on any of these will allow you to navigate to that folder. If you get lost in folders you can click this dropdown and select /class/username (where username is your own username) and this will bring you to your home directory.
An alternative way to go to a specific folder is click the 'Go' menu at the top of Cyberduck and click 'Go to folder'. Here you can write the full path and go to a specific folder. For example, if you are logged in to the cluster through a terminal/putty you can type 'pwd' and then copy that path into the 'go to folder' box and now Cyberduck will be in the same folder as your terminal window.
There are two ways to download files from the class cluster to your computer.
1.If you double click on a file name, this file will be automatically downloaded to your default download folder. A transfer window should open up when you double click on a file. At the bottom there will be a line that starts 'local file'. This is the location of that downloaded file on your own computer
2. An easier way to get files both to and from the class cluster through Cyberduck is through drag and drop. If you have an open finder window (mac) or explorer window (windows) you can click and drag a file from the Cyberduck window to the finder/explorer window directly. You also can do this in the reverse (drag a file from finder/explorer to Cyberduck) to place a file on the cluster in that folder.
Using Cyberduck for remote editing
Instead of using nano or similar to edit files on the class cluster you can use a GUI text editor like TextWrangler through Cyberduck.
In cyberduck click 'File'->'Preferences' on a Mac or 'Edit'->'Preferences' on Windows.
Click the 'Editor' button.
There should be a dropdown menu where you can select a text editor. Select TextWrangler on a Mac, Notepad++ on Windows.
Close this window.
Now when you single click on a file in Cyberduck, a 'Edit' button with the icon for the editor you selected should appear in the top right corner. Click this button to open that file in the editor. Now you can edit the file on the cluster without downloading to your local computer. When you save this file it will be automatically updated on the class cluster.
Short Cyber Duck Exercise
The easiest way to transfer files using CyberDuck is with drag-and-drop. Try to drag a file from your desktop (or another folder of your choosing) from the CyberDuck window. This method allows you to choose unique destinations for each file you transfer.
In CyberDuck, double click example.txt your 'myfolder' on the cluster. To where does this file download? CyberDuck also allows for more permanent modification to how files are downloaded, you can set automatic download locations. If you want to change this, under Edit -> Preferences -> Transfers, you can edit this.
Lastly: Right clicking (Ctrl click on a Mac) will allow you to select Download to or Download As. This will allow you to choose a location, and if you choose, a new file name for the file.
These methods will all work to get files from the cluster to your computer, and each have their own benefits. Generally, you will be fine using any of them throughout the course.
Make a folder on your computer to hold all of your lab materials from this course!
SCP is a good alternative to Cyberduck for linux and Mac's
There are two places you may need to get files on to the class server from: your own computer or an online source
In order to get files from your computer to the server open a terminal window and navigate to the folder on your computer using the commands like cd. Once in the folder containing the file you want to upload you type
scp filename username@classServername:~
e.g. just like cp, the format is scp <from> <to>
To get files from your computer to the cluster:
scp text.txt emctavish@class01:/class/emctavish
To get files from the cluster to your computer:
scp emctavish@class01:/class/emctavish/testfile.txt .
Accessing the cluster from outside MBL
Follow the same instructions from above except: replace the server address (@class07) with @class.mbl.edu and the once on the cluster use ssh class07 (or whatever your appropriate node is), and run your analyses there.
From cyberduck, follow the instructions as above using @class.mbl.edu. All your files on the cluster will be synced to there.
It will be available until Sept 15, but go easy on it next week because the STAMPs course will be using it.
The following table contains a list of commands that will allow us to navigate through the directory structure. The entries are linked to their Wikipedia pages, which contain very useful examples.
|pwd||print working directory||pwd|
|ls||list directory contents||ls|
|history||display command history||history|
|cd||change directory||cd directory_name|
|mkdir||make directory||mkdir directory_name|
|cp||copy files||cp original_filename copied_filename|
|mv||move files (the same as rename files)||mv original_filename moved_filename|
|clear||clear the screen||clear|
|exit||quit command line||exit|
|' '||Ctrl-E||Go to the end of line|
|' '||Ctrl-A||Go to the beginning of line|
- UNIX/Linux command line cheat-sheet: http://fosswire.com/post/2007/08/unixlinux-command-cheat-sheet/
- MS-DOS full command list: MS-DOS commands
- A unix shell tutorial from Software Carpentry: 
- More information from last year