SSH Cloning to repository issue

Hello,

My Macbook is OS X El capitan version.

I created SSH key and added it to my github account. Now, I am trying to clone it into my repository;however, it shows error according to below on Terminal… Could you advise what I did wrong?I tried 10 times modifying config, but still shows same error.

/Users/christineoak/.ssh/config: line 2: Bad configuration option: addkeystoagent

/Users/christineoak/.ssh/config: line 3: Bad configuration option: usekeychain

/Users/christineoak/.ssh/config: terminating, 2 bad configuration options

fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

Thank you

Hi @christinepuget318

Probably need more information on exactly what you have done and your configuration.
A simple test is
ssh -T git@github.com
a response like below line indicates the basic of your configuration are ok and authenticating to GitHub
Hi ! You’ve successfully authenticated, but GitHub does not provide shell access.
ssh -Tv git@github.com (adding the ‘v’ option give a more detailed debug trace of what heppening and key selection etc.

The best way to approach this is normally to follow the GitHub instructions exactly (most peoples problems are due to their local SSH config of keys), then the additional Troubleshooting instructions. If the problem still persists, it is then an easier known position to get assistance.
Following these instructions resolves most peoples problems.
connecting-to-github-with-ssh
troubleshooting-ssh

Give these a go if not already tried .
Good luck but report back here if this does not help and you still need more assistance…

Thank you for the prompt response

I tried to amend config file as follow :

Host *

Port 22

ServerAliveInterval 60

ForwardAgent yes

IgnoreUnknown AddKeysToAgent,UseKeychain

AddKeysToAgent yes

UseKeychain yes

IdentityFile ~/.ssh/id_rsa


And it seems working.

1 Like

@christinepuget318 great to hear you are working and hope you are trouble free for the future

I’ve been all up and down this and can’t seem to resolve the issue. I even tried to copy the files to a usb stick but it must have dependencies that make it look to github.

Everything looks good with my keys accept for the " You’ve successfully authenticated, but GitHub does not provide shell access" it ends with “debug1: Exit status 1” There are some other questionable lines but no "errors. I get this in the beginning:

OpenSSH_7.4p1 Debian-10+deb9u7, OpenSSL 1.0.2u 20 Dec 2019
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to github.com [140.82.112.4] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: identity file /root/.ssh/id_ed25519 type 4
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4p1 Debian-10+deb9u7
debug1: Remote protocol version 2.0, remote software version babeld-06b8a6f1
debug1: no match: babeld-06b8a6f1

The script I’m trying to run is: luarocks build https://raw.githubusercontent.com/tuxd3v/ats/master/ats-master-0.rockspec

Those lines tell me a number of things:

  1. You’re running Git as root, not your regular user. Don’t do that, it’s a security problem to run anything as root that doesn’t actually need root access.

  2. You mentioned a Macbook above, but the log indicates you’re using Debian 10. The keys from your MacOS won’t be available in a container or VM. By the way you should update whatever you run the Debian in soon, Debian 10 will reach EOL in summer. Debian 11 (Bullseye) is the current release.

  3. The log indicates there aren’t any private keys for authentication available. Each of the points above would explain why on its own. :slightly_smiling_face:

How to make things work depends a lot on the details of what you’re actually trying to do.

!. I couldn’t do anything if not logged on as root, or I would have. It took 3 days to get that far and I’m still not sure how that happened.
interesting thing is I just found out this problem isn’t limited to ssh.

  1. Macbook? I mentioned nas you may be confusing me with the previous guy. As far as the operating system goes, I’m stuck with what is available for my hardware.

  2. I disabled the need for private keys on the device I’m ssh’ing into. or I wouldn’t even be able to login. I’ve been looking into creating the local keys but the documentation for that is even worse than creating for github.

Ah, yes, sorry about that. For future reference, if you have a separate question (as you apparently do) please make a separate thread. In that case please disregard my “container or VM” assumption. The point about updating your Debian still remains.

You don’t need to be root to clone a Git repository, unless you’re cloning to a location owned by root. Installing something from the code might require root access, but in that case you should run only the commands that actually need it as root.

According to the log you’re trying to connect to GitHub. GitHub doesn’t accept SSH connections without public key authentication.

If you actually want to connect somewhere else please provide the full context, so people can understand what you’re trying to do and possibly help.

  1. it’s subject matter was the same so I figured you knew how to fix it. unfortunately I couldn’t see what was said to remedy it.

  2. nothing was working until I logged in as root. And still doesn’t.

  3. the private keys were for the connection between my pc and the rockpro64 nas I’m trying to load to with a way of controlling the fan. I managed the creation of keys on github but I just get a different reason why it won’t let me work with it. Need anything else?

TL;DR: You’re trying to use a feature that Apple pulled in as part of their openssh 7.2 upgrade on a system using openssh 6.9.

10.11 El Capitan 6.9p1

https://opensource.apple.com/source/OpenSSH/OpenSSH-209/openssh/ChangeLog.auto.html

commit 555dd35ff176847e3c6bd068ba2e8db4022eb24f
Author: djm@openbsd.org djm@openbsd.org
Date: Tue Feb 23 09:14:34 2016 +0000

upstream commit

openssh-7.2

Upstream-ID: 9db776b26014147fc907ece8460ef2bcb0f11e78

commit f361df474c49a097bfcf16d1b7b5c36fcd844b4b
Author: jcs@openbsd.org jcs@openbsd.org
Date: Sun Nov 15 22:26:49 2015 +0000

upstream commit

Add an AddKeysToAgent client option which can be set to
‘yes’, ‘no’, ‘ask’, or ‘confirm’, and defaults to ‘no’. When enabled, a
private key that is used during authentication will be added to ssh-agent if
it is running (with confirmation enabled if set to ‘confirm’).

Initial version from Joachim Schipper many years ago.

ok markus@

Upstream-ID: a680db2248e8064ec55f8be72d539458c987d5f4

Here’s the openssh-portable reference to the commit:

You can see that the feature became available in openssh-portable in 7.2.

Before randomly copying and pasting configurations from one computer to another, might I suggest you check the documentation to make sure the features used by the configuration are supported?

Fwiw

is “Unsupported as of October 2018”

We’re in 2022. You should not be connecting a computer running El Capitan to the internet.

It’s perfectly fine to use a computer running El Capitan offline and carefully use a sneakernet (or a printer + scanner) to transfer data to/from it. But it should not be connected to the internet.

In the best case, you bought an iMac in mid 2007 and have managed to use it for 15 years (including 5 you shouldn’t have).

The newest hardware that you could have bought to come w/ El Capitan should have been from 2016 which means you’ve gotten at least 7 years (including 5 you shouldn’t have been using El Capitan) out of your product in the worst case. If you indeed have a MacBook from 2016, you can just upgrade it to Monterey and continue to have a supported OS (and as a bonus be able to run a version of OpenSSH that includes the feature you’re trying to use).