CUNIX

From WikiCU
Revision as of 23:38, 29 January 2014 by TheFeynmanParticle (talk | contribs) (How to Connect to CUNIX)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

CUNIX stands for Columbia University UNIX. No word on why it's not called CUUNIX in that case, but CUIT says so on its page about the server. CUNIX is a UNIX-based cluster of hosts that serves the entire Columbia University community. In layman's terms, CUNIX is a part of Columbia's computer network that allows users to remotely access and manage websites, software programs, email, and various other computing tools.

More importantly, CUNIX is a glorious text-based window into the arcane world of Columbia's server. Students can log into CUNIX using their UNI and perform many useful tasks.

Very few undergraduates fully appreciate the potential of CUNIX to help them manage their student groups, individual directories, research projects, and email lists. If you ask politely, CUIT administrators will befriend you and explain the following details to you, but reading the tutorials below should save you years of figuring this stuff out on your own. It may also benefit your resume and your social life.

Overview

CUNIX allows you to do a lot of things.

  • Programs: The server hosts programs for reading email and newsgroups, performing mathematical and statistical analysis, editing text, and programming. While most are also available for purchase, they can be run remotely through CUNIX.
  • CUNIX groups: Permissions, the access rights to various parts of the server, are controlled for files and directories, each of which has an individual and a group owner. The group usually defaults to "user" but can be modified to enable multiple people to read, write, or execute. You can create and manage these yourself or have CUIT do it for you.
  • Web hosting: CUNIX is the gateway to Columbia's web server. Most if not all websites in the columbia.edu space are hosted on CUNIX.
  • Lists: Email aliases used to be created in a shared folder accessible to all students, but today all new ones are managed separately.
  • Looking at stuff: You can view the entire server hierarchy through CUNIX. There's a lot of random and sometimes interesting stuff in there.
  • Tunnel your internet traffic via SSH as a poor man's VPN. This may be useful if you're dealing with sensitive data or you're trying to access websites blocked by content filters

How to Connect to CUNIX

CUNIX is accessed through SSH or SFTP, and can be accessed through any UNIX shell. For example, use the Terminal on Mac OS X or PuTTY on a Windows PC. If one of these programs is installed, it will open automatically on most machines if you type ssh:// into the URL field of your web browser.

If you're using any other operating system, you already know how to connect to CUNIX.

To actually log in to CUNIX, you need your UNI and one of the following basic commands:

ssh UNI@cunix.cc.columbia.edu ssh UNI@cunix.columbia.edu sftp UNI@cunix.cc.columbia.edu sftp UNI@cunix.columbia.edu ssh UNI@pine.columbia.edu

Add the -X flag if you wish to tunnel X11 applications (e.g. Emacs). The command would then be ssh -X UNI@cunix.cc.columbia.edu.

pine.columbia.edu goes only to the Pine mail program; all other combinations go to the main shell prompt. You will be asked for your "KerberosV Password," which is just the normal password associated with your UNI. The end result will look something like this:

$ ssh UNI@cunix.columbia.edu
KerberosV Password: 
Last login: Date from location
Sun Microsystems Inc.   SunOS 5.9       Generic May 2002
$ 

At the

$

prompt, you are ready to enter commands. If you are in SFTP mode, the prompt may look like this:

sftp>

SSH mode allows modification of groups and use of programs; SFTP mode is useful for file transfer to and from websites hosted under columbia.edu. For the latter, a program that has a GUI may be more useful.

Tutorials

Rather than detail each and every function of CUNIX, this section will walk through some of the most commonly used features. It presupposes a basic understanding of UNIX commands.

Contents

  • How to edit your home directory (www.columbia.edu/~UNI)
  • How to create and manage CUNIX groups
  • How to manage and control access to student group websites (usually www.columbia.edu/cu/GROUP)
  • How to see and edit simple email lists
  • How to run programs on CUNIX
  • How to look at random stuff on CUNIX

Home directory

Every Columbia affiliate has access to a small portion of the Columbia server where he or she can post pretty much anything. It is then accessible at http://www.columbia.edu/~UNI.

The original author of this page was going to write a tutorial on how to do this, but then realized CUIT already has one. See Creating Personal Pages to get started.

CUNIX groups

Similarly, the CUIT tutorial on how to get started with CUNIX groups isn't bad. See Managing UNIX Groups for more information on modifying file permissions, including technical jargon like "turn the sticky bit on".

You should know that as with many commands in UNIX, you can simply type "group" at the prompt, and CUNIX will return a list of commands you can use to manage groups. You can see which group(s) you are already a part of by entering the command

$ groups

Groups are important because they enable a number of individuals to share the same permissions for a file or directory. Since only the "owner" (an individual, group, or both) can edit most files and directories, groups are essential for controlling access to websites and email aliases. Groups are only accessible through SSH mode.

Websites

If you are a member of an existing group, you should have a directory on the Columbia server of the form http://www.columbia.edu/cu/GROUP. Many departments also use this syntax, though any group deemed important enough that asks for it can potentially have a subdomain instead, e.g. http://stat.columbia.edu and http://cusj.columbia.edu. How the latter got a subdomain as an undergraduate group has more to do with tenacious bureaucratic wrangling than the relative importance of CUSJ.

Anyone can see the websites listed in /cu/ directory. Navigate to it by typing:

$ cd /www/data/cu/

If you have access to a website in this directory, you can then modify its contents as if it were your home directory. If you represent a student group, you may need to get in contact with a previously graduated member of the group in order to have them change the ownership on the group to your new webmaster and/or a CUNIX group. CUIT can also do this for you. Any member of the assigned CUNIX group will be able to post files to that directory. From within the /cu/ folder, you can list the complete contents and see who owns which files using the ls -l command, though this will take some time. The resulting output will look like this:

$ ls -l
total 2504972
drwxrwsr-x   24 wbm1    twoone                    4096 Aug 31  2000 21stC
drwxrwxr-x   47 djp22   c250                      4096 Jul 19 11:11 250
drwxrwsr-x    2   36159 www                       4096 Nov 18  2003 3-2house
...

The left-most line records the current permissions of the group. d denotes a directory, as opposed to a file. The next 9 digits indicate the read, write, and execute rights for the user, group, and everyone respectively. A dash indicates lack of rights and the letter indicates permission. In the examples above, everyone can read and execute the contents of the directories, but only the users and groups listed can write to them. An 's' in place of the x for groups indicates that the sticky bit is on, and group rights will be inherited. The remaining columns, in order, are the number of directories within the directory, the individual owner or creator, the group owner if it exists (otherwise it will be 'user' or 'www' or 'staff' or some other default), the file size, date of last modification, and the name.

If you are a member of a recognized student group that does not have a website, you must have your advisor contact CUIT with a formal request. If your student group is not recognized, apply to a governing board first.

Aliases

Until recently, all simple email lists, called aliases, were stored in a shared directory accessible via CUNIX. New email lists are no longer visible to everyone and must be managed through a console located here. For some reason, very few people know this. Majordomo listservs and public folders are other CUIT mass-mailing services that are controlled separately.

In any case, a large number of pre-existing aliases are still stored on CUNIX at

$ cd /sharemail/aliases

Most of these are obsolete, but others are still in use. Each points to the name of the alias @columbia.edu. Each alias is a simple text file that can be easily edited to change recipients, assuming one has the proper permissions. As with any other file or directory, aliases can be assigned an individual and/or a group owner, which can be changed only by the current owner(s) or CUIT.

  • As of January 2008, it appears that many aliases are being transitioned over to the web-based console and are no longer accessible through this directory. That makes me sad.

Editing an alias requires the use of a text editor, either Pico or Emacs, which are among the programs available on CUNIX. To edit an alias, the command from the /sharemail/aliases directory is

$ pico aliasname

or

$ emacs aliasname

Programs

There are a wealth of programs available on CUNIX which can be accessed from anywhere in the world. They are listed on this page. Most economics majors will use STATA in their econometrics class, engineers and math or science majors will probably refer to Mathematica and Matlab, and statistics students often use SAS or R. Most of these programs can be launched simply by typing the name at the shell prompt, e.g.

$ R

Some packages require a graphical interface for full functionality. To display charts in STATA on a Macintosh, for example, one must open the X11 console instead of the normal Terminal and run STATA using the command

$ xstata

Pine, an email client that allows text-based browsing of one's Columbia email account, is faster than CubMail for many basic tasks. As mentioned above, it can be launched either from within CUNIX

$ pine

or independently

$ ssh UNI@pine.columbia.edu

Pico and Emacs are two fully-featured text editors for use within the CUNIX environment. Pico is recommended for beginners. MM is another email reader.

Server hierarchy

There is likely much much more to CUNIX than this page indicates, and one of the best ways to explore it is to simply click through the server tree. Ever wondered where to find a list of all the active UNIs in the system? Wonder no more, simply do the following from your home directory:

$ cd ..
$ cd ..
$ ls
$ cd a
$ ls

You've just listed every existing user beginning with A. Repeat for the other letters of the alphabet as desired. Similarly, you can navigate to any of the many many many other directories within CUNIX by starting out at

$ cd /

and using the ls command (ls -a to see all files, ls -l to see rights and permissions) to see what's out there. Similarly of interest might be the complete list of email aliases, or anything else of the sort. Enjoy!

References

See the various Wikipedia articles and CUIT pages linked from this article for more information.