Skip to content

Recognise when a user is trying to validate a private SSH key

Problem

User repeatedly pastes his private key rather than his public key into the SSH key field (https://gitlab.com/profile/keys). He doesn't understand why he is receiving an error message.

This problem was identified as part of the following research study: ux-research#53 (closed)

To do

  • Recognise when a user has accidentally copied and pasted their private SSH key instead of their public SSH key. Inform them with a clear input field validation error message.
  • Update current copy via following changes/additions on the SSH keys settings page

New wording for labels, descriptions, placeholders

  1. Block description
Is Suggestion
Before you can add an SSH key you need to generate one or use an existing key. To add an SSH key you need to generate one or use an existing key.
  1. New "Key" description
Is Suggestion
n/a Paste your public SSH key, which is usually contained in the file '~/.ssh/id_rsa.pub' and begins with 'ssh-rsa'. Don't use your private SSH key.
  1. "Key" placeholder
Is Suggestion
Don't paste the private part of the SSH key. Paste the public part, which is usually contained in the file '~/.ssh/id_rsa.pub' and begins with 'ssh-rsa'. Typically starts with "ssh-rsa …" (?)
  1. New "Title" description
Is Suggestion
n/a Name your individual key via a title
  1. "Title" placeholder
Is Suggestion
empty e.g. My MacBook key

Proposed design

Add key form Form alert
image image

User flow when private key is entered

  1. User pastes the key
  2. User fills in the Title input field ('Add key' button becomes enabled)
  3. User clicks on 'Add key'
  4. Alert shows up
  5. User checks the key, deletes it from 'Key' text area and pastes in the correct public key
  6. User clicks on 'Yes, it's not private'
  7. The key is added

Changes introduced

  • Moved long placeholder text from 'Key' text area outside of it, below the 'Key' label as paragraph text.
  • Changed the 'Key' text area placeholder to a shorter and helpful one
  • Added an example placeholder text to the 'Title' input field
  • Added a warning alert that shows up when we think the key might be private.
Edited by Matej Latin