Generating SSH keys for GitLab on OS X 10.11

2

I've got GitLab CE installed and I'm trying to set up an SSH key so I can push my git repos to GitLab, but there's inconsistency with what the documentation says I should be getting and what my machine is producing.

The guide I'm following is here: http://docs.gitlab.com/ce/ssh/README.html

The section in question is this, which refers to creating the ssh key on OS X:

To generate a new SSH key, use the following command: ssh-keygen -t rsa -C "$your_email"

When I do this on my Ubuntu or Red Hat machines, I get a file called ~/.ssh/id_rsa that has this single line that the web form accepts:

$ cat ~/.ssh/id_rsa
ssh-rsa AAAAB3Nz[...redacted...]NqWrR [my email address]

When I do this on OS X, I get this multiline value that doesn't start with ssh-rsa and the web form rejects it:

$ cat ~/.ssh/id_rsa
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAs7YoIGUi0hqe0GQIj5II+DBbg7F8i2D1JKYSBuOevm6espZG
                        [...redacted...]
Igwp/AI+ic6Vo2lLEEYYMXCsmJ3N/UAuY8zTsqRVuZCvfSF23szhAw==
-----END RSA PRIVATE KEY-----

Is there a way to generate the kind of key that GitLab expects on OS 10.11?

screenshot of GitLab rejecting the OS X key

Kyle Falconer

Posted 2016-07-13T19:31:37.793

Reputation: 127

Answers

1

You are doing it wrong. You should put there public key (~/.ssh/id_rsa.pub), not the private part. It should be

$ cat ~/.ssh/id_rsa.pub

Jakuje

Posted 2016-07-13T19:31:37.793

Reputation: 7 981

don't know how I overlooked that... thanks! – Kyle Falconer – 2016-07-13T20:28:24.133