]> sipb.mit.edu Git - wiki.git/blobdiff - doc/using-athena.mdwn
(no commit message)
[wiki.git] / doc / using-athena.mdwn
diff --git a/doc/using-athena.mdwn b/doc/using-athena.mdwn
new file mode 100644 (file)
index 0000000..36cdc73
--- /dev/null
@@ -0,0 +1,108 @@
+# Using Athena
+
+For this series of tutorials, we’re going to assume that you’re familiar with the basics of how to use the command line.
+
+## Connecting to Athena
+
+The use of SSH (Secure Shell) allows a computer to remotely login into another computer/server, while making use of adequate security features. Thankfully, most operating systems have an SSH program already built in and no additional installs are needed on your machine. You can SSH into Athena by following these steps.
+
+First, open your OS’s respective terminal. Then enter
+
+```
+ssh [kerberos]@athena.dialup.mit.edu
+```
+
+but replacing `[kerberos]` with your Athena username. So, for example, if your username is `aphacker`, you would type into the terminal `ssh aphacker@athena.dialup.mit.edu`.
+
+If successful, ssh will tell you (in your _first_ time):
+
+```
+Host key not found from the list of known hosts.
+Are you sure you want to continue connecting (yes/no)?
+```
+
+Type `yes', and now it will respond:
+
+ ```
+Host 'athena.dialup.mit.edu' added to the list of known hosts.
+aphacker's password:
+```
+
+Type your password and press Enter. Note, you will not see any characters as you type your password; this is a security feature.
+
+Now you’ll be prompted to complete two-factor authentication via Duo.
+
+```Enter a passcode or select one of the following options:
+
+ 1. Duo Push to XXX-XXX-0000
+ 2. Phone call to XXX-XXX-0000
+ 3. SMS passcodes to XXX-XXX-0000
+
+Passcode or option (1-3):
+````
+
+Type an option number and press Enter. Do your two-factor authentication. With luck, the terminal will print a bunch of startup text, finally ending with a line like
+
+```
+aphacker@scrubbing-bubbles:~$
+```
+
+You have now been dropped into an Athena shell. Like the terminal on your computer, you can type commands and they will execute. For example, you can type `pwd` and see
+
+```
+aphacker@scrubbing-bubbles:~$ pwd
+/afs/athena.mit.edu/user/a/p/aphacker
+```
+
+**Note:** If your computer does not have `ssh`, you could also use shellinabox, an online terminal for using Athena that can be found [here](https://athena.dialup.mit.edu/). It’s not ideal, though, as it will log you off if you’re idle for a few minutes. (Which is probably not what you want when you’re following a guide like this.)
+
+## Serving a website from AFS
+
+Now that you’re in Athena, you can access the files in AFS. Right now, you are in your home directory for AFS. There are several subdirectories in your home directory, but the important one to focus on right now is `~/www`.
+
+Files in your `~/www` directory are available on the internet through a URL, and more specifically of the form factor `https://web.mit.edu/aphacker/www/`. If you go to that URL right now though, you won’t see anything (besides a error). We can change that by making a small web page under that directory.
+
+First, `cd` into the `www` directory.
+
+```
+aphacker@scrubbing-bubbles:~$ cd www
+aphacker@scrubbing-bubbles:~/www$
+```
+
+Then, run the following command to make a file named `index.html` with a simple HTML5 template
+
+```
+aphacker@scrubbing-bubbles:~/www$ echo '<!DOCTYPE html><title>Hello World!</title>' > index.html
+```
+
+If you now visit your URL at `https://web.mit.edu/aphacker/www/`, you will see the web page you made! It’s a blank page with the title “Hello World!”.
+
+You can edit the webpage you just made by running a text editor like nano or Vim.
+
+```
+aphacker@scrubbing-bubbles:~/www$ nano index.html
+```
+
+This should bring up a screen with the current contents of `index.html`, which you can now edit. You can read more about how to use nano elsewhere, but for now, it’s enough to know that pressing <CTRL-O> and then Enter will save the file, and <CTRL-X> will exit you from nano.
+
+## Using SCP
+
+Editing a file through a remote shell isn’t the best way of making a file, however. A program called SCP (Secure Copy), which is bundled with SSH, allows copying files from your computer to AFS.
+
+To copy a file from your computer to AFS, open your terminal and enter a command like
+
+```
+scp file.txt aphacker@athena.dialup.mit.edu:~
+```
+
+This will copy a file called `file.txt` to your home directory in AFS. You’ll have to do two-factor authentication with Duo, similar to SSH.
+
+You can [read the documentation](https://linux.die.net/man/1/scp) for more information about how to use SCP.
+
+## What next?
+
+For more information about what AFS is, see:
+
+- [AFS at MIT - An Introduction](http://kb.mit.edu/confluence/display/istcontrib/AFS+at+MIT+-+An+Introduction)
+- [AFS and You](https://sipb.mit.edu/doc/afs-and-you/)
+- [AFS Locker Maintenance Guide](http://kb.mit.edu/confluence/display/istcontrib/AFS+Locker+Maintenance+Guide)