• Skip to main content
  • assistive.skiplink.to.breadcrumbs
  • assistive.skiplink.to.header.menu
  • assistive.skiplink.to.action.menu
  • assistive.skiplink.to.quick.search
  • Metropolia.fi
  • Curricula
  • Wiki
  • Moodle
Metropolia
Menu
    • Attachments (27)
    • Page History
    • Page Information
    • Resolved comments
    • View in Hierarchy
    • View Source
    • Export to PDF
    • Export to Word
  • Browse
    • Pages
    • Blog
    • Labels
    • Space Operations
  • Login
    • Metropolia Login
    • Haka Login
    • Visitor Login

IT Services

  1. Dashboard
  2. IT Services
  3. …
  4. Front page
  5. Software and Systems
  6. Remote Connections
Print
Main navigation

Creating an SSH Key Pair and Logging in on a Linux Server (shell.metropolia.fi)

Generating SSH Keys

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

    Internal 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

24-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

Login 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.

      File 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.

SFTP-yhteys WinSCP ohjelmalla

  1. Open WinSCP.
    1. Press Kuva Windows-näppäimestä.
    2. Type "WinSCP" in the search field.
    3. Click the WinSCP icon..

  2. In the "Protocol" section, select "SCP," and in the "Host name" field, enter shell.metropolia.fi, then press "Save."

  3. Press OK.

  4. Click on shell.metropolia.fi, then select "Edit" and "Advanced."

  5. Go to the "Authentication" section and locate the "Private key file" from the saved directory.


  6. Change the file type filter at the bottom right to show "All Private Key Files."


  7. WinSCP will inform you that the key is in the wrong format and will prompt you to save it in the correct format.


  8. Choose a name and save location for the .ppk key, then press "Save."

  9. Press OK.

  10. Press Save and Login.

Did You Encounter a Problem?

  1. Restart your computer and the device where the issue is occurring. Try the function again.
  2. If the function you are attempting is happening in a web browser, try the function again in an incognito or private window and in a different browser.
  3. Try searching for a solution on the site of the IT Services by using the following search methods:
    1. navigation menu of the site (on the left)
    2. search machine of the wiki (right upper corner)
    3. a general search engine, for instance Google Search
    4. alphabetical index
    5. FAQ

If the problem is not resolved, please contact the helpdesk according to best practices. Always include a full screen screenshot of the issue in your service request.

Contact methodContact information
Ask AI-Bot Mikko 24/7

https://mikko.metropolia.fi

Form

https://hd.metropolia.fi

Email

helpdesk@metropolia.fi

Phone service+358 9 7424 6777 (weekdays from 8 am to 4 pm)


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


  • Created by Samuli Tani, last modified by Unknown User (attepel) on 29.8.2024
  • No labels
Overview
Content Tools
Apps
Pages
Blog
Labels
Space Operations
  • Powered by Atlassian Confluence 8.5.26
  • Printed by Atlassian Confluence 8.5.26
  • Report a bug
  • Atlassian News
Atlassian