Skip to content

kennedy

The following gives some instructions on how to get an account on kennedy and then login.

Getting an account

  • Register for an account 🔗.
  • Create a public ssh key.
    • Follow these instructions.
    • I would not enter a password and leave the folder as the default.
    • You should have created a private key (id_rsa) and a public key (id_rsa.pub). For me, these were saved to /Users/joshduffield/.ssh/.
  • Email the public key to Herbert (herbert.fruchtl@st-andrews.ac.uk) so he can make you an account.
    • He should then email you a username and password.
  • If on Mac, install XQuartz on your local computer.

Login

Username

Your kennedy username will probably be the same as your normal St Andrews one. In the following, I have left my username, jamd1, so just replace this wherever it appears with your username.

  • To login, run the following in terminal
    ssh jamd1@kennedy.st-andrews.ac.uk
    
  • You may get the following message:
    The authenticity of host 'kennedy.st-andrews.ac.uk (138.251.14.67)' can't be established.
    ED25519 key fingerprint is SHA256:eZyafolEFuPQuBBSJtBr55VbWI9Hmuko3GUkuV0vfaw.
    This key is not known by any other names
    Are you sure you want to continue connecting (yes/no/[fingerprint])?
    
    If so, just say yes
  • Then it will call for the password:
    jamd1@kennedy.st-andrews.ac.uk's password:
    
  • If logged in successfully, the following should appear:
    Last login: Fri Sep 30 16:07:23 2022
    Welcome to kennedy
    Please find information about using it at the HPC website:
    https://www.st-andrews.ac.uk/high-performance-computing/
    [jamd1@kennedy10 ~]$
    

Change Password

On first login, the password should be changed using the command passwd:

[jamd1@kennedy10 ~]$ passwd
Changing password for user jamd1.
Current Password: 
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.
[jamd1@kennedy10 ~]$ 

File Transfer

Using Terminal

You can exchange files between your local computer and kennedy using terminal:

sftp jamd1@kennedy.st-andrews.ac.uk
jamd1@kennedy.st-andrews.ac.uk's password: 
Connected to kennedy.st-andrews.ac.uk.
sftp> 

  • Then use cd <dir> to change directory
  • put <file> to move file from local computer to kennedy.
  • get <file> to move file from kennedy to local computer.

I find it easiest to exchange files using FileZilla which has a graphical interface.

  • Download it from this website
  • Next, you need to specify the private key which was created earlier.

    • In FileZilla, in the top bar, click Edit and then Settings.
    • Then click Connection/SFTP and then Add key file.
    • Select the private key created earlier i.e. it should be called id_rsa.
      image.png
    • Then press OK
      image.png
    • This comes from the On a Mac section on the wiki.
  • Now, in the top bar, click File and then Site Manager

    • Create a New Site for kennedy.
    • Protocol: SFTP
    • Host: kennedy.st-andrews.ac.uk
    • Username and password is the same as used to login.
      image.png
    • Then click Connect and it should hopefully work with a screen like the following appearing.
      image.png
  • You should now be able to drag and drop files from the local computer (left) to kennedy (right) and create new directories etc.

CONDA

Installation

To install CONDA, login and then run install-conda in terminal. This should then produce some files in the location /gpfs1/apps/conda/jamd1/conda:
image.png

Create Environment

To create a python 3.9 conda environment called test_env run:

conda create -n test_env python=3.9
Then to activate it, run:
conda activate test_env
Terminal should then look something like this:
(test_env) [jamd1@kennedy10 ~]$

Error - Wrong Python Version

Error

If you now run python -V to check the python version, it will print Python 2.7.5 even though the conda environment is python 3.9.

This is because it is using the wrong python. If you run which python, it will print /usr/bin/python which has nothing to do with the test_env CONDA environment.

The problem is that the python installed using CONDA does not have execution permissions, so it reverts to a python version which does. To give execution permissions, you can run the following line (The $USER will automatically be your username so you don't need to change it):

chmod u+x /gpfs1/apps/conda/$USER/conda/envs/*/bin/*

If you now run conda deactivate and then conda activate test_env to log out and then back into the CONDA environment, python -V should now print Python 3.9.13 and which python should print
/gpfs1/apps/conda/jamd1/conda/envs/test_env/bin/python.

In general, whenever you hit a Permission Denied error when using a CONDA environment, I would run chmod u+x /gpfs1/apps/conda/$USER/conda/envs/*/bin/* as a first attempt at fixing it.

Resources

There is a website for kennedy. There is also a recorded lecture and the corresponding lecture notes.

These may be useful, especially if using an operating system other than Mac.