# Connecting to Triton¶

Tutorials: previous, next.

You can connect to triton.aalto.fi from Aalto and CSC networks. Aalto networks include: Wired workstation networks, eduroam, and the aalto wireless network only if you are using an Aalto managed laptop (otherwise aalto is like aalto open). If you connect to the Aalto VPN, you will be on the Aalto networks.

For SSHing to Triton from outside of your department or CSC, please login first to a university server (like kosh.aalto.fi or taltta.org.aalto.fi) and then open a session to triton.aalto.fi.

Note

Are you here for a SciComp KickStart course? You just need to make sure you have an account and then be able to connect via ssh (first section here), and you don’t need to worry about the graphical application parts. Everything else, we do tomorrow.

Note

Triton uses Aalto accounts, but your account must be activated first.

## Connecting via ssh¶

### Linux¶

All Linux distributions come with an ssh client, so you don’t need to do anything. To use graphical applications, use the standard -X option, nothing extra needed.:

ssh triton.aalto.fi


If you are from outside the Aalto networks:

ssh kosh.aalto.fi         # or ssh [email protected]
ssh triton.aalto.fi


### Mac¶

ssh is installed by default, same as Linux. Run it from a terminal, same command as Linux. To run graphical applications, you need an to install an X server (XQuartz).

### Windows¶

You need to install a ssh client yourself: PuTTY is the standard one. If you want to run graphical programs, you need an X server on Windows: see this link for some hints.

You should configure this with the hostname, username, and save the settings so that you can connect quickly.

If you are outside the Aalto networks, you need to first connect to kosh.aalto.fi or some other server, and then use the Linux instructions to connect to Triton.

### Exercise¶

1. Connect to Triton. List your home directory and work directory.
2. Check the uptime and load of the login node: uptime and htop. What else can you learn about the node?
3. Go ahead and change your shell to bash (see next item).

## Change your shell to bash¶

The thing you are interacting with when you type is the shell - the layer around the operating system. bash is the most common shell, but the Aalto default shell used to be zsh (which is more powerful in some ways, but harder to teach with). For new users (if you joined Aalto after autumn 2018) you should have bash as the default. We recommend that you check and change your shell to bash.

You can determine if you shell is bash by running echo \$SHELL. Does it say bash?

If not, ssh to kosh.aalto.fi and run chsh. Enter the full path /bin/bash and click OK. It may take 15 minutes to update, and you will need to log in again.

Note: this section is only for connecting to Triton. Once you are connected the first time, a key for internal connections is automatically made.

### Linux¶

We highly recommend you follow these steps on the first login to set up passwordless SSH. This will make your life much more pleasant, and can be used when connecting to computers other than Triton. Using keys will save you the trouble of entering passwords every time, since ssh stores the key once and uses it for logging you in in the future.

First, create the keypair on your own computer. Do not copy private keys from other computers - one computer=one private key, and copy only the public key (.pub) to any computer you want to log in to. Protect your SSH keyfiles with a passphrase. When asked to enter one, use 3+ words, mixing languages, CAsE, or inflection, but make it something you can remember without sticky notes. xkcd has some opinions on this. A key without a passphrase is like a password just sitting on disk - so be careful here. Passwordless keys are OK in certain cases, such as internal triton connections.

ssh-keygen -o


Then, copy the key to computers you want to log into: Use the ssh-copy-id script to copy the public key file to Triton. This will put the key in ~/.ssh/authorized_keys (you can check this file to see everything that’s there). (To do this manually, put the contents of .ssh/id_rsa.pub file into ~/.ssh/authorized_keys on Triton. If you do this yourself, you may set set the permissions on .authorized_keys file: chmod u=rwx .ssh/, chmod u=rw .ssh/authorized_keys.)

Finally, you should be able to login automatically. A program called ssh-agent (or gnome-keyring) decrypts the key once and holds it and uses it each time you need to connect. If it doesn’t work automatically, try running ssh-add once.

### Mac¶

You can follow same instructions from Linux.

### Windows¶

Realistically, on windows setting up keys takes some time. You don’t need to worry about it (you will still have an ssh key on triton that is used for internal connections).

You can make keys using puttygen. Here is a tutorial. You should make a new key for each computer you have.

## Advanced: set up ssh config file (Linux/mac)¶

Openssh on linux can be made nicer if you set up a config file (.ssh/config):

# Host alias triton: "ssh triton" instead of "ssh triton.aalto.fi".
# You can set more options here.
Host triton
Hostname triton.aalto.fi
# Only if not on Aalto networks:
# Next line *automatically* proxies you through kosh.aalto.fi.  You
# probably want to set up a "kosh" host if username is different, and
# set up public key authentication on kosh too.
ProxyCommand ssh kosh.aalto.fi -W %h:%p
# Defaults for all hosts.
Host *
# Following two lines allow SSH to reuse connections - second connections
# open very fast.  If problems (channels exceeded), disable it.
ControlMaster   auto

You’ll actually learn this in the next section, the data storage tutorial. It is easiest to mount them using SMB, and on Aalto workstations and taltta.aalto.fi they are mounted at /m/triton/{scratch,work}/. You can also use an sftp (which works over ssh, so will work from anywhere you can access Triton) client such as Filezilla to transfer files. See the next tutorial (or FAQ).
ssh is one of the most fundamental Linux programs: by using it well, you can really do almost anything from anywhere. The .ssh/config file is valuable to set up. If ssh is annoying to use, ask for some help in getting it working well.