Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #900

Closed
Open
Created Jun 06, 2012 by Administrator@rootOwner

"New key" should fix misformatted SSH key to prevent "error: key_read: uudecode" while cloning repo

Created by: mikem2005

Steps to reproduce (Ubuntu 12.04)

  1. Create a SSH key with ssh-keygen
  2. 'cat' public key to terminal
  3. Copy key from terminal and paste into the GitLab "key" textfield.
  4. Click 'Save', observing that everything appears to have worked correctly
  5. Attempt to git clone a repo
  6. Observe prompt for git@... password. This means that ssh is falling back to password auth because the public key on the server was invalid. Digging into server's /var/log/auth.log I noticed a line "error: key_read: uudecode AAAA...that has a space and ends with \n". Thus, it appears that copying a copy with line breaks into the textfield causes a multi-line entry in authorized_keys, which is not allowed.

Fix:

  1. Remove linebreaks from key before persisting

auth.log Lines: Jun 4 18:10:00 git sshd[7731]: error: key_read: uudecode AAAAB3NzaC1yc2EAAAADAQABAAABAQC5akdhG/P1tioNGsXKCyOcJH+BxKGNu2Q1L1UhPlIRtDZfCYARDbAgYy8uobrOe9kaCDnPK5UR+jJUlNs0Zy3NaGio+1awc t Ljt/X5AavWOIqW9qJYxo7ZJL8SV5Qz8ihEu9WQKJGkQoelEnEhS9HUBgZ39zAglZ+yMHrscb4Fh58774w1QgWws7BkHlsCQHMy7ynQyWSPBuasuvq6u6v7G+gSTOMK0dLGL6ae\n failed Jun 4 18:10:06 git sshd[7731]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.10.101 user=git Jun 4 18:10:08 git sshd[7731]: Failed password for git from 192.168.10.101 port 59080 ssh2

Assignee
Assign to
Time tracking