Archive for October, 2010

Uploading to CUNIX (psst, it’s super easy)

Oct 29 2010 Published by adicu under Tutorials

If you want to use CUNIX to store files or webpages, you could use command-line utilities like PUTTY or the Linux SSH utility, but it is more convenient to use graphical utilities that allow you to drag and drop files onto CUNIX as if it was a location on your own computer. CUNIX allows you to do this through a protocol called SFTP, which is based on SSH and FTP.

Windows

To SFTP on Windows, the easiest way is to use WinSCP, which you can download from winscp.net. Run the installation program. Choose custom upgrade. When it asks you to select the components you want to install, do not select any of the language extensions (unless you want any of them). When it asks if you want to install a plugin for Firefox, say no. When it asks you what type of interface you want, choose the “Explorer-like interface” option. This one is a bit easier to use.

Once the installation is finished, open up the program (there should be a shortcut on your desktop). In the sidebar on the right, click the button labeled “New”.

In the field labeled “Host name”, type cunix.columbia.edu. In the field labeled “User name,” type your UNI. DO NOT fill in your password in the field labeled “Password.” Click the button labeled “Save” and press “OK” in the opened dialog. Finally, press “Login”.

You will be asked to verify the CUNIX server’s SSH certificate and then for your password. Once you’ve done this, you should be able to see your home directory on CUNIX.

You can add files by dragging and dropping, and you can open files just by double-clicking. Since you’ve saved your session, you can log on again just by double-clicking the link in your “stored sessions” box.

Linux

If you’re running a Linux distribution with GNOME as your Desktop Environment, you can sftp onto a server simply by using the Nautilus file manager. To do this, click on the Places menu in the GNOME panel and select “Connect to Server”. This will open up a dialog. From the drop-down menu labeled “Service type,” select SSH. Then, in the field labeled “Server” type cunix.columbia.edu. In the field labeled “User Name,” type in your UNI. For the field labeled “Folder,” you should enter the name of your home directory on the CUNIX server. To find this out, open up the terminal, SSH onto the CUNIX server, and type the command “pwd.”

This will print out your current directory, which is the home directory.

Copy and paste this directory into the “Folder” field. Finally, check the checkbox labeled “Add Bookmark” and type in the name you want to give this connection. “CUNIX” would probably be the best choice. Hit OK.

Your computer will ask you to verify the CUNIX server’s SSH certificate. Press OK. It will then prompt you to enter your password. Type in your password and press “Connect.” You should now see a Nautilus window displaying your home directory on CUNIX. Congratulations, you did it. You can now drag and drop files from your computer onto the CUNIX server. You can also edit files using your own graphical text editor instead of the command-line Emacs editor on CUNIX.

A shortcut should also appear on your desktop saying “sftp for <your UNI> on cunix.columbia.edu.” When you want to disconnect, close the Nautilus window, right-click on the shortcut on your desktop, and select “Unmount.” In the future, you can connect by clicking the bookmark in your “Places” menu.

One response so far

Columbia wants you to have a website!

Oct 21 2010 Published by adicu under Tutorials

Do you attend Columbia? Great, you have webspace allocated to you! That’s right, Columbia is willing to host a website for you, a real website that anyone can get to. It’s hosted on your CUNIX account, and you can navigate to it by going to http://columbia.edu/~uni1234 where you replace UNI1234 with your own uni. For example, my uni is mnn2104, so my url is http://columbia.edu/~mnn2104. The url is case sensitive, which means that it matters whether the letters are capitalized or not—they should all be lowercase.

If you navigate to your webpage and there isn’t anything there, or it gives you 404 error, do not be alarmed! This probably means that either you don’t have anything in your public_html directory, or that you have not set the permissions correctly.

If you are already familiar with CUNIX and how to navigate to the public_html directory, you can skip this section.

If you are on a UNIX or UNIX-like machine, such as a Linux machine or Mac OS X, use terminal to log into CUNIX.

If you are on a Windows machine, you’ll need to install PuTTY and use it to log into CUNIX, then come back to this. For a tutorial, click here.

Some useful CUNIX commands:

cd is change directory. Directories are sometimes also known as folders, and you can move from one folder to another using the cd command. After typing cd, type the directory you wish to move to.

ls is list, and it lists all of the elements that are currently in the directory.

ls -l lists all of the elements that are currently in the directory, as well as all of the permissions.

pwd is print working directory, and it lists the address of the directory you are in.

chmod is change mode, and is used to change permissions on files. chmod is followed up 3 numbers from 0-7, and then the name of the directory. The numbers specify admin, user, and global respectively. 1 specifies executable, 2 specifies writable, and 4 specifies readable. Any combination of permissions that you want to give admin, user, or global can hence be uniquely specified by summing each permission that you want to give. If you want to give all three all access, use chmod 777 filename. To give just admin access, use chmod 700 filename, to give just owner access, use chmod 070 filename, to give just the world access, use chmod 007.

Type in ls, and hit enter or return. You should see something like this:

Now you’re going secure shell tunnel or “ssh” into your CUNIX account.  This will let you mess around in CUNIX as if it were your own computer.  There’s lots of fun things you can do in CUNIX (which is a kind of UNIX, like your operating system), but for now we’re going to ignore most of them.

To ssh in, type ssh uni1234@cunix.cc.columbia.edu (again, substituting your uni for uni1234) and hit enter or return.

If this is your first time logging in, there will be a warning that says, ‘The authenticity of host . . .’

Type in yes, and his enter.

After that, type in your password associated with your uni. Again, this is case sensitive. You might notice that no letters appear where you’re typing—this is a security measure, in case people are looking over your shoulder, and also to protect against Van Eck Phreaking.

This is what it should look like after you have finished entering your password:

Now hit return. If you typed your password in correctly, you are now logged into CUNIX!

Basic terminal commands:

cd is change directory. Directories are sometimes also known as folders, and you can move from one folder to another using the cd command. After typing cd, type the directory you wish to move to.

ls is list, and it lists all of the elements that are currently in the directory.

ls -l lists all of the elements that are currently in the directory, as well as all of the permissions.

pwd is print working directory, and it lists the address of the directory you are in.

chmod is change mode, and is used to change permissions on files. chmod is followed up 3 numbers from 0-7, and then the name of the directory. The numbers specify admin, user, and global respectively. 1 specifies executable, 2 specifies writable, and 4 specifies readable. Any combination of permissions that you want to give admin, user, or global can hence be uniquely specified by summing each permission that you want to give. If you want to give all three all access, use chmod 777 filename. To give just admin access, use chmod 700 filename, to give just owner access, use chmod 070 filename, to give just the world access, use chmod 007.

Type in ls, and hit enter or return. You should see something like this:

You just listed the items in the directory that you’re currently in! You might only have public_html and a few other items, but that’s okay—public_html is the only one we’ll use.

Type in cd public_html. This will change the directory that you’re in to public_html, which is where your webspace is.

Now type in emacs index.html and hit return. Emacs is a text editor, and index.html is the default page that going to your webspace will redirect the user to. Because ssh is text only, you cannot click other places on the page, and you must navigate using your arrow keys. There are also emacs commands to navigate the page, but we’ll save those for another tutorial. If your first page looks like this:

hit ctrl+l to actually go to text editing.

The text that you want to paste into emacs is:

<html>
<head>
<title>Greetings</title>
</head>
<body>
<p>Hello World</p>
</body>
</html>

However, you will probably not be able to just copy and paste it into emacs—again, because this emacs is text-only, you can’t right-click and paste, and emacs’ version of paste, yank, only works internally to emacs, so you should manually type this in. It should look like this:

To save, type x while holding ctrl, followed by s while holding ctrl. They will ask you at the bottom of the screen if you want to save—type y, and it will save. To save and quit, type x while holding ctrl, followed by c while holding ctrl—the save prompt works in the same way.

After you have quit, type in chmod 664 index.html and hit enter. This will give read and write permission to admin and owner, and read-only permission to the world, which will let everyone in the world see your webpage.

Now use your browser of choice (firefox, chrome, safari, opera, internet explorer) to navigate to your webpage (http://columbia.edu/~uni1234). Congratulations, you have your own page on the world wide web!

If you’d like to create something a little more “professional,” check out tutorials on HTML and CSS. Lots of useful tech tutorials can be found on Lynda.

One response so far

Get up and running with PuTTY

Oct 21 2010 Published by adicu under Tutorials

If you use Windows, you most likely do not have an installed SSH client. PuTTY is a SSH client with support for Windows. So why do you need a SSH client, anyway? To connect to Columbia’s CUNIX servers, of course. Plus, the terminal makes you feel like your a real BAMF.

Columbia provides a link to PuTTY (you may be asked to enter your uni/password combo to download the file). You can also download PuTTY from the website of its creator. If you are unsure of which version to download, just choose PuTTY for Windows Intel x86.

CUIT download page for PuTTY

Once the download is complete, install the program. The default settings are fine – just keep on clicking next until the setup is complete.

Hopefully this is a familiar sight. If not, just click next.

Eventually, you will arrive at the screen below. Click finish and start  PuTTY.

Click "Finish". Now take a break after all that hard work, you deserve it!

The boxes marked with a red dot are fields that have been changed. Click the save button to save this session permanently. In the future, you can select “cunix” and load to load these settings.

These settings are important. Copy them as shown.

A window will pop up, asking you to authenticate the server’s host key. Click yes.

See, Windows IS secure.

Enter your user name when prompted.

It's like the Matrix, but without the white rabbit and red pills. You'll have to supply those yourself.

If you successfully followed each of these steps, you’re now connected to Columbia’s CUNIX server. What’s CUNIX you ask? Well, that’s a topic for another tutorial. To see how to use CUNIX to set up a personal website, click here.

3 responses so far