0

I have an Ubuntu 15.10 X64 and I am working on a project for which I am trying out GIT. I have created a repo on one of our remote servers, which is a Debian server, and the repo is accessible via SSH from command line as well as from Intellij. If you need any info, please let me know

enter image description here

I am trying to access it via a GIT-UI tool called GitGraken. It is looking for ssh keys for our remote server. How can I get those keys and add it for my user on the system so I can keep an eye on the repository. Any help would be nice.

5

You can create a ssh keypair in the terminal with the command: ssh-keygen. Then you have to add the public key(.pub).

see man ssh-keygen for more options

  • Shouldn't there already exist a key on the server as it's running an open-ssh server? Shouldn't I add it? – We are Borg Apr 14 '16 at 10:52
  • 2
    @WeareBorg no, installing SSH doesn't automatically create a keypair for you. You have to do so with ssh-keygen. – muru Apr 14 '16 at 10:57
  • @user68186, yes, thx! Ive edited my post. sorry for that issue. .pub --> Public Key. Never share or transfer your private key – DanG Apr 14 '16 at 12:00
1

Use ssh-copy-id

If your local machine has the ssh-copy-id script installed, you can use it to install your public key to any user that you have login credentials for.

Run the ssh-copy-id script by specifying the user and IP address of the server that you want to install the key on, like this:

ssh-copy-id demo@SERVER_IP_ADDRESS
  • I get an error : /usr/bin/ssh-copy-id: ERROR: No identities found – We are Borg Apr 14 '16 at 11:07
0

Finally, this link from debian helped. I created a key first with following command on my local machine :

ssh-keygen -t rsa

Then I copied contents of the public key(/home/username/.ssh/id_rsa.pub) into authorized keys on the server. After that I was able to login without password and solve the problem.

  • 1
    Isn't this what the other two answers tell you to do? – muru Apr 14 '16 at 11:34
  • @muru : DanG's did, but was not detailed enough. But was helpful.. I have accepted it as the answer. Thank you. :-) – We are Borg Apr 14 '16 at 11:35
  • Actually copying the key to authorized_keys on the remote server is ssh-copy-id's job. – muru Apr 14 '16 at 11:37
  • @muru : It is not working though, that's the first thing I tried after creating the key, dunno why its failing. – We are Borg Apr 14 '16 at 11:37
  • I guess it is pointless now that you have copied the key, but does ssh-copy-id -i ~/.ssh/id_rsa throw any errors? – muru Apr 14 '16 at 11:54

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.