1

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.

3 Answers 3

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

3
  • Shouldn't there already exist a key on the server as it's running an open-ssh server? Shouldn't I add it? Apr 14, 2016 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, 2016 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, 2016 at 12:00
2

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
1
  • I get an error : /usr/bin/ssh-copy-id: ERROR: No identities found Apr 14, 2016 at 11:07
1

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.

10
  • 1
    Isn't this what the other two answers tell you to do?
    – muru
    Apr 14, 2016 at 11:34
  • @muru : DanG's did, but was not detailed enough. But was helpful.. I have accepted it as the answer. Thank you. :-) Apr 14, 2016 at 11:35
  • Actually copying the key to authorized_keys on the remote server is ssh-copy-id's job.
    – muru
    Apr 14, 2016 at 11:37
  • @muru : It is not working though, that's the first thing I tried after creating the key, dunno why its failing. Apr 14, 2016 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, 2016 at 11:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .