Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Generating SSH Keys

  1. Log in with your Metropolia credentials at https://sshauth.metropolia.fi.

    Note
    titleInternal Network or VPN

    Access to https://sshauth.metropolia.fi requires Metropolia's internal network or VPN service.
    Instructions for using the VPN service are available here: VPN Connection via GlobalProtect Service.


  2. Select Accept.

  3. Open the code for two-factor authentication from the message sent to your Metropolia email.
  4. Enter the code in the form.
  5. Select Verify 2-factory code.

  6. Select Create New SSH-key pair.



  7. Select Download current SSH-private key.



  8. Save the key to your desired folder on your computer.

Check the status column to see if the key pair has been activated. Refresh the view by pressing Ctrl+R or clicking the browser's refresh icon. Activation takes about 15 minutes.


Key statusStatus message
Non-activeWait for server configuration before ssh login. Usually takes about 15 minutes
ActiveSSH-Keys OK



Warning
title24-hour Time Limit

The private SSH key is stored on the service for 24 hours. Download the key before the deadline.

How do I create a new key pair if I have deleted or lost my previous key file?

Create a new key pair according to the Generating SSH Keys instructions.

How do I completely stop using a key pair and disable logins?

  1. Log in according to the Generating SSH Keys instructions at https://sshauth.metropolia.fi.
  2. Disable the key pair by using the Delete current ssh keys function.

SSH Login from a Workstation

Info
titleLogin and Key Pair Status

Login only works if the key pair status on the site https://sshauth.metropolia.fi is marked as SSH-Keys OK.

SSH Connection from Windows Command Prompt


  1. Open the Windows Command Prompt.
    1. Press Kuva Windows-näppäimestä.
    2. Type cmd in the search field.
    3. Open the Command Prompt application.

  2. Navigate to the folder where the key is stored.
  3. Change the file permissions to a format accepted by the SSH software by entering the commands:

    icacls <ssh-key file name> /Inheritance:r
    icacls <ssh-key file name> /Grant:r "%Username%":"(R)"

  4. Log in to the server by entering the command:

    ssh –i <ssh-key file name> <short Metropolia username>@shell.metropolia.fi

  5. If the SSH program gives a message:
    The authenticity of host 'shell.metropolia.fi (195.148.105.150)' can't be established.
    ECDSA key fingerprint is SHA256:JmKwxqzHvpLgmGW6o+PId0GmdalnHMdsG0jDlINUG3c.
    Are you sure you want to continue connecting (yes/no/[fingerprint])?
    1. Type yes.
    2. Press Enter.

      Warning
      titleFile Permissions on Network Drives

      If you have stored the SSH key on a network drive, it is possible that the file permissions do not save correctly with the icacls commands, and the SSH command line software does not create a connection, giving an error message "WARNING: UNPROTECTED PRIVATE KEY FILE!". In this case, change the storage location of the key to your computer's hard drive and start following the instructions from the beginning.


SSH Connection Using PuTTY on Windows

  1. Open the PuTTY Key Generator program.
    1. Press Kuva Windows-näppäimestä+R.
    2. Type puttygen in the text field.
    3. Click OK.
  2. Select Conversions → Import key.

  3. Select the private SSH key you saved.
  4. Save the key in PuTTY format to your desired folder.


  5. Establish SSH Connection with PuTTY.
    1. Open PuTTY
      1. Press Kuva Windows-näppäimestä.
      2. Type putty in the search field.
      3. Click the PuTTY icon.

    2. Go to the menu Connection → SSH → Auth → Credentials.
    3. Set the saved PuTTY format SSH key file in the Private key file for authentication field.


    4. Fill in the server details in the Session section in the format <short Metropolia username>@shell.metropolia.fi.
    5. Save the session by giving it a name in the Saved Sessions field and click Save.

    6. Log in to the server by clicking Open.



    7. Click Accept in the security warning window.


    8. If the connection opens, but no text is printed in the PuTTY window:
      1. Close PuTTY.
      2. Restart PuTTY.
      3. Double-click the saved session.

SSH Connection from Linux Command Line

  1. Navigate to the folder where the key is stored.
  2. Change the file permissions to a format accepted by the SSH software by entering the command:

    chmod 600 <ssh-key file name>

  3. Kirjaudu palvelimelle syöttämällä komento:

    ssh –i <ssh-key file name> <short Metropolia username>@shell.metropolia.fi


  4. If the SSH program gives a message:
    The authenticity of host 'shell.metropolia.fi (195.148.105.150)' can't be established.
    ECDSA key fingerprint is SHA256:JmKwxqzHvpLgmGW6o+PId0GmdalnHMdsG0jDlINUG3c.
    Are you sure you want to continue connecting (yes/no/[fingerprint])?
    1. Type yes.
    2. Press Enter.

Did You Encounter a Problem?

Include Page
Did You Encounter a Problem?
Did You Encounter a Problem?


SSH-avainparin luonti ja kirjautuminen Linux-palvelimelle (shell.metropolia.fi)