Connecting to M3 via SSH
This page will take you through how to connect to M3 using SSH (Secure SHell). If you're familiar with ssh
already, then simply connect to M3 with the below command using your HPC ID username and password
ssh username@m3.massive.org.au
If you are not familiar with ssh
, read the appropriate section below for your operating system. If you have trouble at any step, please contact our help desk.
As explained in Create your HPC ID account, you must use your HPC ID username and password to connect to M3, not your usual organisational credentials.
Linux and macOS Users
First, open your Terminal application. For macOS users, search Spotlight for "Terminal", or open Finder, navigate to Applications > Utilities and double click on Terminal.app
. With your terminal open, type
ssh username@m3.massive.org.au
where you replace username
with your HPC ID username, and press enter. Enter your HPC ID password at the prompt and you will be directed to an M3 login node (we'll explain what this means later). Enter yes
if you see the The authenticity of host can't be established
warning (see Verifying the host key for details).
Windows users
Start by downloading PuTTY if you don't already have it from: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html. Then open PuTTY. You should see a dialog box. Then do the following:
- Set the 'Host Name' to
username@m3.massive.org.au
where you replaceusername
with your HPC ID username. - Set the 'Connection type' to SSH.
- Click the 'Open' button to connect to M3.
- Enter your HPC ID password when prompted.
- Enter
yes
if you see theThe authenticity of host can't be established
warning (see Verifying the host key for details).
Have I connected?
If you have connected properly, you should see a bash prompt similar to below:
[lexg@m3-login3 ~]$
Advanced topics
Verifying the host key
If this is your first time connecting to M3, you will see a message like
The authenticity of host 'm3.massive.org.au (118.138.254.221)' can't be established.
ED25519 key fingerprint is SHA256:/n6MOjwQ0XPiwiXXLfv0eu8S8aL32M8tX9uzBNtOra0.
This host key is known by the following other names/addresses:
~/.ssh/known_hosts:1: [hashed name]
Are you sure you want to continue connecting (yes/no/[fingerprint])?
Type yes
and press enter to continue connecting. This host key is just an identifier for the login node. You should not see this prompt again (unless the M3 login nodes' IPs or domain names change).
SSH keys
You may be familiar with using passwords to authenticate to M3 - ssh keys are another, more secure method of authenticating. If you're unfamiliar with ssh keys, no worries - we'll step you through how to set one up here. If you want to learn more about why ssh keys are more secure than passwords, this YouTube video for AWS does a good job of explaining it.
The process for creating keys and adding them to your ssh agent differs between Windows and Linux/Mac.
Mac and Linux Instructions
Note: These instructions will refer to your local terminal, as well as the Strudel2 terminal. Pay attention!
Firstly, we need to generate an ssh key-pair. Open a local terminal, and run the following command:
ssh-keygen -t ed25519
You will be asked where you would like to save the keys. Press enter to keep the default location. You will also be asked to enter a passphrase. This will be used to encrypt the private key on your computer. There will be a print out of your key's fingerprint and location on the screen.
You should now have a public and private key in your ~/.ssh
directory,
which will be named id_ed25519.pub
and id_ed25519
respectively. Never share your private key with someone else.
Secondly, you will need to copy your public key into M3. To do this, run the following command:
cat ~/.ssh/id_ed25519.pub
Copy the line of text printed on the screen.
Start a terminal session in
Strudel2
by selecting Terminal
from the sidebar on
the left-hand side of the screen, and then selecting Run on Login Node
.
This will open a terminal on M3 in a new tab. Ensure you have copied the public key from before, and run the following command in the Strudel2 terminal:
echo (paste the line you just copied) >> .ssh/authorized_keys
This will add your public key to M3 and allow you to authenticate using your new ssh-keys. Close the Strudel terminal tab and terminate the terminal session.
Finally, you will want to add your ssh keys to the ssh-agent. You will remember setting a passphrase earlier for accessing your private key. When you add a private key to the ssh-agent, it will ask for your passphrase once, and then remember it until the next time your computer reboots. This means you won't need to enter a passphrase everytime you log in to M3 with your keys.
To do this, open a local terminal and run:
ssh-add ~/.ssh/id_ed25519
Windows Instructions
Install and enable OpenSSH
1. Check OpenSSH is installed
Navigate to
Settings > Apps > Apps & Features
.Select
Optional Features
.Check if
OpenSSH Client
is in the list. If it is, go to step 2.If it isn't, select the
Add a feature
button at the top of the page, then selectOpenSSH Client
andInstall
. This will install the OpenSSH Client.
2. Once installed, you will need to start the OpenSSH Client
Use the Windows search bar to search for and open
Services
.Scroll through the list to find
OpenSSH Authentication Agent
.Double click
OpenSSH Authentication Agent
. Change the Startup type toAutomatic
and selectOK
.Double click on
OpenSSH Authentication Agent
again and selectStart
.
The OpenSSH Agent will start automatically in future. Now we can create your ssh keys!
Create ssh keys and add them to the ssh-agent
Note: These instructions will refer to your local terminal, as well as the Strudel2 terminal. Pay attention!
Firstly, we need to generate an ssh key-pair. Open a PowerShell terminal, and run the following command:
ssh-keygen -t ed25519
You will be asked where you would like to save the keys. Press enter to keep the default location. You will also be asked to enter a passphrase. This will be used to encrypt the private key on your computer. There will be a print out of your key's fingerprint and location on the screen.
You should now have a public and private key in your ~/.ssh
directory,
which will be named id_ed25519.pub
and id_ed25519
respectively. Never share your private key with someone else.
Secondly, you will need to copy your public key into M3. To do this, run the following command:
cat ~/.ssh/id_ed25519.pub
Copy the line of text printed on the screen.
Start a terminal session in
Strudel2
by selecting Terminal
from the sidebar on
the left-hand side of the screen, and then selecting Run on Login Node
.
This will open a terminal on M3 in a new tab. Ensure you have copied the public key from before, and run the following command in the Strudel2 terminal:
echo (paste the line you just copied) >> .ssh/authorized_keys
This will add your public key to M3 and allow you to authenticate using your new ssh-keys. Close the Strudel terminal tab and terminate the terminal session.
Finally, you will want to add your ssh keys to the ssh-agent. You will remember setting a passphrase earlier for accessing your private key. When you add a private key to the ssh-agent, it will ask for your passphrase once, and then remember it until the next time your computer reboots. This means you won't need to enter a passphrase everytime you log in to M3 with your keys.
Copy paste the location of your private key, which would have been printed on the screen in your
PowerShell terminal earlier. For example, C:\Users\username/.ssh/id_ed25519
.
Run the following in your PowerShell terminal to add the key to your ssh-agent:
ssh-add (path\to.ssh/id_ed25519)
X11 forwarding
Currently, X11 forwarding is only possible on the login nodes, not the compute nodes. This means you can run basic graphical applications on the login node via X11 forwarding, but please don't put a heavy load on the login nodes. Instead, we suggest you use Strudel desktops for any graphical applications.