简体   繁体   中英

Adding ssh key to gitlab

I installed Gitlab on a Fedora 17 server following this guide and I believe everything works fine, except that I cannot add ssh keys or push my local repository to the server.

When trying to add a SSH key via the web interface I get the message "Fingerprint cannot be generated"

When I try to push the local repo to the server with

    git remote add origin git@myserver:user/repo.git
    git push -u origin master

It asks me for the password of the git user, which I cannot introduce since it does not have one. How can I fix this? I've tried to search the logs for debugging information but could not find anything.

edit: I've tried adding my public rsa key to authorized_keys and I can ssh without entering the password (the session closes because login is disabled for this user). However, when I try to push origin master I get the following

    fatal: protocol error: bad line length character: This

About the "Fingerprint cannot be generated" : GitLab needs access to /tmp for generating fingerprints, and SELinux might be preventing that. Relevant Discussion on GitHub

You have to use OpenSSH version of key.

Under *Linux you can get this version of key with command: ssh-keygen -i -f /tmp/id_rsa.pub >>

Under Windows you can use Pyttygen application: open your key, then menu Conversions -> export OpenSSH key.

I guess it helps you :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM