Skip to content

⚡ Log in to Rahti from the CLI

Summary
This tutorial shows you how to log in to Rahti from the CLI.
Internet
https://rahti.csc.fi
flowchart LR
    A(Log in to<br>rahti.csc.fi) --> B(Select<br>'copy login command'<br>under username)
    B --> C(Log in to Rahti service again)
    C --> D(Click 'Display token' link and copy oc command)
    D --> E(Open the terminal)
    E --> F(Paste and execute the <code>oc</code> command)

Prerequisites

  1. CLI tools are installed.
  2. Successful login to the Rahti service over the web.

🟩 Procedure

Log in to Rahti service's web page. Select 'Copy login command' 1⃣ from the menu under the username.

Copy login command

Click on the 'Login' 2⃣ button.

Log in to the Rahti

Authenticate with your CSC account or Haka login.

Once you have successfully logged in, click the Display Token 3⃣ link.

Display Token Link view

If you want to use the oc command, copy the first command 4⃣ from the web page.

Token view

Then open the terminal and paste the command into the command line.

Info

Please note that the example token below is invalid and you must use the token from your own environment.

Terminal
$ oc login --token=sha256~HtQgn28ZQLDdk2tD3ZHs_mMaAFAuQTfHvKKfmmT9_3Z --server=https://api.2.rahti.csc.fi:6443
Logged into "https://api.2.rahti.csc.fi:6443" as "cbrown" using the token provided.

You have one project on this server: "basics-of-containers"

Using project "basics-of-containers".
$ _

That's it!

Now you have an access to your Rahti environment from the command line.

You can test the access by typing the command oc whoami and the command should respond with your active username.

Terminal
$ oc whoami
cbrown
$ _

Further Learning

Here are some suggestions for what to read next: