Skip to content

How to login

There are two main ways of accessing the LUNARC systems:

  • The LUNARC HPC desktop, described in a separate guide
  • Terminal and command-line tools

This document describes the second item: how to access our system using a terminal and command-line tools. To get access to a terminal the user has to login in to LUNARC using a Secure Shell (SSH) terminal client, for example:

ssh cosmos.lunarc.lu.se -l username

or

ssh username@cosmos.lunarc.lu.se

On Linux and macOS this client is built-in to the system and no installation is necessary. Windows do not have a standard SSH terminal so an external application is needed such as PuTTY is needed. However, windows users are recommended to use the HPC desktop

To authenticate to the LUNARC system a two-factor authentication solution is used. Two-factor authentication uses two factors for authentication instead of just one, e.g. a username and password. In the LUNARC case the two factors are:

  1. Username and password.
  2. One-time password generated by the Pocket Pass app on your smartphone.

When you apply for an account your mobile number is registered in our user database. This will be used when first connecting to our system. Users have to switch to the Pocket Pass app before they can access the systems.

The login process is described in the following sections.

Logging in using One Time Passwords (OTP)

Logging in to the LUNARC system with OTP passwords is not very different from a normal SSH login, except for the additional extra password prompt. A typical session is shown in the following example:

login as: joeuser 
Password: 
Please enter your onetime password: 123456

If the OTP and password are correct you will be logged in to the system.

Linux

To be prompted for the OTP password the ssh client must be configured for keyboard-interactive login. These settings can be modified in either /etc/ssh/ssh_config (Redhat systems) or in the home-directory ~/.ssh/config. An example configuration is shown below:

Host cosmos.lunarc.lu.se 
PreferredAuthentications keyboard-interactive

Host * 
PreferredAuthentications hostbased,publickey,keyboard-interactive,password

In the above example, COSMOS is configured for keyboard-interactive login, but all other hosts are configured with default login options.

To reduce the number of logins to the system the ServerAlive option can also be added:

Host cosmos.lunarc.lu.se 
PreferredAuthentications keyboard-interactive 
ServerAliveInterval 10

Host * 
PreferredAuthentications hostbased,publickey,keyboard-interactive,password

macOS

macOS is already configured to handle the login to LUNARC resources with one time passwords (keyboard-interactive).

To reduce the number of logins to the system the ServerAlive option can also be added:

Host cosmos.lunarc.lu.se 
PreferredAuthentications keyboard-interactive 
ServerAliveInterval 10

Host * 
    PreferredAuthentications hostbased,publickey,keyboard-interactive,password

macOS 10.7 Lion and 10.8 Mountain Lion

To login to a LUNARC system from a Mac system running Mac OS X 10.7 and 10.8, you need to unset the box "Set locale environment variables on startup" in the settings window of the terminal application, and press [cmd] + , to get there.

English example:

Setting locale in lion (english)

Swedish example:

Setting locale in lion (english)

Note: This works on a per-theme basis. In the above examples, you will need to choose the theme "Homebrew" to connect to the LUNARC servers.

Windows

To be prompted for the OTP password the PuTTY client must be configured for keyboard-interactive login. Open PuTTY from the start menu. Load the session options for your selected resource. Open the Connection/SSH/Auth item in the tree view. Make sure the "Attempt "keyboard-interactive" auth (SSH-2) is checked in the settings, see the following image:

To reduce the number of logins to the system the "Seconds between keepalives" can be changed to a value greater than 0. See the following figure:

putty_keyboard_interactive


Author: (LUNARC)

Last Updated: 2023-05-29