# ODIN

Odin is a server for Computer Science students, permitting them to submit homework assignments, work on code, and have a Linux environment to use when they don’t have the resources to run Linux. It is very similar to the Polaris system that Clarkson runs, except that they run Red Hat Enterprise Linux, and we run Debian Linux.

## Sections:

• Using SSH
• On Windows
• On Mac and Linux
• Using SSH - A quick guide to Linux commands
• Troubleshooting SSH
• My SSH client says something about HOST VERIFICATION FAILED
• Could not resolve hostname
• Permission Denied
• Using SCP and WinSCP (for moving files from computer to computer)
• SCP
• WinSCP

## Using SSH

SSH, also known as a Secure SHell, is a secure manner to log into this machine. Using SSH is very simple, but requires basic knowledge of a computer terminal to use effectively. This guide’s aim is to help you navigate the terminal effectively.

### On Windows

Windows does not by default come with an SSH terminal emulator. You will need to download the PuTTY terminal emulator, conveniently linked here. All you need to do is download the stable Windows executable named putty.exe. You can also use the PuTTY MSI installer for a more permanent installation, but that is not necessary.

After starting PuTTY, a small dialog box with many options will pop up. On the right side, there will be some options.

Hostname: odin.cosi.clarkson.edu
Port: 22
Connection Type: SSH

After you select these options, you should be able to click on the Open button a the bottom right of the application window.

After you do this, there may be a verification popup asking if you are sure you want to begin connecting to the host. Clicking Yes will continue to connect to the server. Every other time you connect from this computer, you will not see a popup.

Now, a new window with a terminal emulator will appear, which will prompt you to enter your username and password (and it will ask you to change your password if you are logging in for the first time)

Once you have properly connected, your session should show a prompt, as seen below:

username@odin:~$When you see this prompt, you have successfully connected to Odin. ### On Mac and Linux A SSH client is built into Mac and Linux, so using SSH is much simpler on one of these machines. Simply enter the following command into your favorite terminal emulator or TTY, replacing username with your username. ssh username@odin.cosi.clarkson.edu When you connect, it may ask you to save the keys, just type yes to that prompt, and you will never see it again on that particular computer. After that, you should be prompted for your password, and if it’s your first time connecting ever, will ask you to change your password. After all of this, you should have a SSH prompt, which looks like the line below: username@odin:~$

When you see this prompt, you have successfully connected to Odin.

## Using SSH (A Quick Reference of Linux Commands)

Here’s a quick listing:

• exit Exits the current SSH login, returning to a terminal or closing the terminal window.
• ls Lists all of the files in the current working directory (folder), adding -a to see dotfiles, and adding -l to see permissions and file sizes, among other things.
• pwd Lists the Present Working Directory, or where you are currently located in the filesystem. This defaults to your home directory, or a folder that serves as your personal documents and configuration files.
• cd [location] Changes Directory to the file location
• mv [origin] [new-location] Moves a file from one location from another
• cp [origin] [copy-location] Copies a file from one location to another
• rm [filename] Removes a file permanently from the system. Use -i to get a verification step. Use -r to remove multiple files at once from a directory
• touch [filename] Creates an empty file
• nano [filename] Opens the Nano editor with a file. Use CTL-X to exit and CTL-O
• vim [filename] Opens the Vim editor with a file. Use i to insert text, :w to write to the file, and :q to exit the editor. Use the EXC key to break from a mode command. Use :!q to exit without saving changes.
• emacs Is it a text editor or a computer terminal? :D (If you don’t understand, there’s an ongoing battle between vim and emacs) I don’t know how to use emacs, but here’s a helpful guide. You won’t find it on Odin though, because the list of dependencies is ridiculous.
• g++ [filename].cpp The C++ compiler, used for making programs. Passing -o in front will instead use a specificed filename, for example g++ compile-me.cpp -o application
• ./a.out This command runs the default compiled output (or application) from a compiled C++ file. This file is a platform dependent executable file (similar to a .exe file on Windows). If you passed the -o flag to g++ then you will need to instead run ./[exec name]. For example, from the compilation above, you would run ./application

## Troubleshooting SSH

Sometimes errors generated by SSH may not be very clear. This section aims to help you understand what went wrong

### My SSH client says something about HOST VERIFICATION FAILED

This problem is rare, but happens when a SSH keypair changes. If you are running Linux or Mac, you need to remove the ~\.ssh/known_hosts file. In Windows you have to carefully remove the key(s) from the registry.

### Could not resolve hostname

This problem is rather common, and occurs when your computer is not connected to the internet. Also, check to make sure that your DNS settings work (if you can browse in a web browser they are good)

## Using SCP and WinSCP

SCP is short for Secure File Copy, and is used to copy from one computer to another.

### On Linux and Mac - SCP

Open a terminal, and enter the following:

scp [from location] [to location]

When using SCP, you need to specify a location. It can be one of the following:

• A remote filesystem: username@odin.cosi.clarkson.edu:[path to file] where path to file is either an absolute path (for example, /home/students/username/filename.txt) or a relative path (for example, filename.txt
• A local filesystem: Either an absolute path or relative path to the folder you’re in (see pwd above)

### On Windows - WinSCP

Install WinSCP from here and install it. The GUI should behave much like Windows File Explorer, and has a similar login interface to PuTTY (it may call it SFTP, which is the same as SCP). If you have further questions, please contact us.

Odin is a server run by the Clarkson Open Source Institute (also known as COSI).
It provides a virtual classroom workspace for multiple classes, including introductory and advanced CS courses.