You will need three pieces of infrastructure for this course:
This page walks you through the process of setting each of them up. (You will perform these steps as part of lab 0.)Note on your working environment
Some of our labs will use machines administered by CIMS (short for Courant Institute of Mathematical Sciences, which is the home of the CS department). Thus, Step 1 is to make sure that you have a CIMS account. Most of you already do, thanks to the CIMS sysadmins, but check which of the following cases covers your situation:
This account is independent of your NYU NetID/home account. This account will be valid during the semester and will give you access to all of CIMS's computing resources.
Step 2 is to use your account. The two options are described below.You can use the physics desktop machines in the Computer Labs in Rooms 229 and 230 Warren Weaver Hall. You can find more information about these labs here. You will want the Linux machines. Type your CIMS username and password to login.
If you are not on campus, then you can use ssh to gain access to both the desktops and a collection of servers that CIMS maintains. We describe the steps below. At a high level, you will be logging into a machine called access.cims.nyu.edu, and from there you will login to the CIMS machine of your choice. Please do not skip that second part and do your work on access.cims.nyu.edu; this sort of behavior is viewed as antisocial.
Follow these steps:$ ssh -X [username]@access.cims.nyu.edu
In this command, [username] is your CIMS username. access.cims.nyu.edu is the hostname of the CIMS's entrance server. When you use ssh to connect to other computers, you will have to replace this (often with an IP address). The -X tells ssh to forward X server which will allow you to run graphical programs on the remote machine using your host machine's screen.
The first time that you attempt to ssh to any new remote host, you can usually say "yes" to the following warning message (but if you are worried, you can check the claimed key fingerprint against the expected fingerprint, if you have it):
$ ssh -X [username]@192.168.56.101 The authenticity of host '192.168.56.101 (192.168.56.101)' can't be established. ECDSA key fingerprint is SHA256:t4YwH+injA3LLJsDPIOrclFGf3NIz1isMvahvfiZnys. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.56.101' (ECDSA) to the list of known hosts. [username]@192.168.56.101's password: ....
For all users, if you have successfully logged in, you will see a banner like this:
############################################################################ # # # CIMS Access Server # # # # ** Unauthorized access is prohibited by law! ** # # # # Please do not run CPU-intensive jobs on this server. For # # information regarding appropriate systems on which to run such # # processes, see: # # # # http://cims.nyu.edu/u/computeservers # # # # Users requiring a Solaris SPARC environment can login to # # crunchy12.cims.nyu.edu # # # # If you have any questions, please send mail to: # # helpdesk@cims.nyu.edu # # # ############################################################################Consult this list to choose a server. From access.cims.nyu.edu, type the following command:
$ ssh -X [username]@[server].cims.nyu.edu
Set up "ssh keys", which will remove some of the hassle of typing your password every time you ssh to a machine. A brief tutorial for the OS X / Linux uses is given below:
$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/username/.ssh/id_rsa): /your/path/here/<keyname> Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /your/path/here/<keyname>. Your public key has been saved in /your/path/here/<keyname>.pub. ....
$ cat /your/path/here/<keyname>.pub ssh-rsa ABCAB3NzaC1yc2EAAAADAABCEFEBDSAQClJLOOqwgsSDlcjXqJ/J9pTyPJIfpXLQWocjXcwZ2 EFQRUhl9WbQgOVKXDfkAaIajgl2k9maguYsZQb/lH1N4i7F9ge+XqawW2SwBVCWoOpO7A8lJxWDOS6CDD Q7tZZasclkjE039cjlsdkfJq3lcjaseoijasdCLKEHFOKEj1l2kASJclekHFo3k1sjcKEal0eMbWgx/7P 3NOanLYOB4x8IhQVYYbGt1d+i0laoBVvqycVnOydRyOPxzZSlgUYUO+nTP4V1CYCLlRj5Qce9KA05/zmW COKEJF03ICJ3a9U43e9FRUB1wq2RLFDLbWP19e0EHVKXcJEHFiOECcN my@email.edu
$ vim ~/.ssh/authorized_keys
$ ssh -X -A [username]@access.cims.nyu.edu -i /your/path/here/<keyname> # login should succeed, with no password # now you are logged into access.cims.nyu.edu $ ssh -X [username]@[other-cims-machine]The purpose of the -A is to forward your authentication information from your local machine to access.cims (in this way, access.cims can "get you into" the second machine). Otherwise you would need to re-authenticate, by typing your password, to the second machine.
$ vim ~/.ssh/configAdd the following lines
Host cims Hostname access.cims.nyu.edu User [username] IdentityFile /your/path/here/<keyname> ForwardAgent yes ForwardX11 yes
# Full ssh command to ssh to the remote $ ssh -A -X [username]@access.cims.nyu.edu -i /your/path/here/<keyname> # Abbreviated command $ ssh cims
Much of what we will do in this class is hardware-specific. One way to ensure that we are all using a uniform platform is for us to use identically configured virtual machines. You can think of a virtual machine as a way to create an encapsulated machine (in our case, an Ubuntu server running on an i686 machine) on top of another operating system (the one that controls your laptop or desktop).
To get our virtual devbox running, do the following:
On approximately one-quarter of the physical machines we tested the virtual box on (all natively running Linux), the boot process appeared to hang. You can overcome this issue by pressing [Alt]+[F2] a few seconds after boot. This switches to tty2, the second input terminal (tty is short for teletypewriter), and seems to bypass the error.
Our virtual machine contains an installation of Ubuntu 14.04 Linux. The following accounts have been created on the VM.
Username | Password | Purpose |
---|---|---|
root | cs480 | Use this account when you need to install new software packages using apt-get install pkgname |
httpd | cs480 | Use this account for everything else (including your dev work). |
You can access the virtual machine directly by using its console or by using ssh to log into the box over the (virtual) network. You'll need to use ssh at some point either way, so familiarize yourself with the following instructions now. Reread this for a reference on ssh.
To determine the virtual machine's IP address (hostname) for the ssh command, you can log in as the root user on the console and run:$ /sbin/ifconfig eth0 eth0 Link encap:Ethernet HWaddr 08:00:27:19:99:1a inet addr:192.168.56.101 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: 2604:2000:1303:80c1:9de1:e218:838a:c3b5/64 Scope:Global inet6 addr: fd59:5f87:5403:0:a00:27ff:fe19:991a/64 Scope:Global inet6 addr: fd59:5f87:5403:0:9de1:e218:838a:c3b5/64 Scope:Global inet6 addr: 2604:2000:1303:80c1:a00:27ff:fe19:991a/64 Scope:Global inet6 addr: fe80::a00:27ff:fe19:991a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:112 errors:0 dropped:0 overruns:0 frame:0 TX packets:94 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:14540 (14.5 KB) TX bytes:11235 (11.2 KB) $
For example, to ssh onto this machine from an OS X/Linux machine, do:
$ ssh -X [username]@192.168.56.101
If you do not already have an account on github, sign up for one here. Feel free to select the "Free yearly" plan.
We highly suggest using ssh keys in combination with git. To set this up, see the tutorial here.
You will submit your github user information to us in the last part of lab 0.
It is often helpful to have multiple terminals open on one machine when you are coding / testing a program. For your local machine, you can open multiple terminal windows, but for a remote host, you'll have to open multiple ssh sessions. Doing this will also often allow you to copy/paste directly to the remote machine, change the size of your terminal, and generally customize what you see.
It may be most convenient to access the virtual machine via ssh too. That is, the local virtual machine should be regarded as a server, and you will ssh into that "machine", as described above.
Last updated: 2016-04-15 16:24:02 -0400 [validate xhtml]