I cannot connect with SSH from my command line to push files to my Github account. That is the last step before I can start publishing projects on my public profile. I have read the tutorials and obtained the keys. When I type git push origin master, the updates do not appear on my Github repo. Can you help? Thank you.
You appear to have an ssh key registered:
You should see something like this:
% ssh firstname.lastname@example.org Hi jsoref! You've successfully authenticated, but GitHub does not provide shell access.
(It helps to know what OS you’re running.)
If the above works, you can try:
git clone email@example.com:dougdevitre/travel.git
this is the error I receive when I type ssh firstname.lastname@example.org
no such identity: /Users/dougdevitre/.ssh/id_ed25519: No such file or directory
email@example.com: Permission denied (publickey).
In fact, you have two keys:
- ssh-rsa (4096 SHA256:zFTw3DhY6WeGizNu0RrDPlUYMDFqnnukrjU3jsL642M no comment (RSA))
- ssh-ed25519 (256 SHA256:CJ9fd4Vt09M37fy+b2mY6RU3ct/M5UhACyLu2MQkdpE no comment (ED25519))
What instructions did you follow?
For debugging, you can try:
ssh -v firstname.lastname@example.org
it should yield something like:
% ssh -v github.com OpenSSH_8.1p1, LibreSSL 2.7.3 debug1: Reading configuration data /Users/jsoref/.ssh/config debug1: /Users/jsoref/.ssh/config line 1: Applying options for * debug1: /Users/jsoref/.ssh/config line 97: Applying options for github.com debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 47: Applying options for * debug1: Connecting to github.com port 22. debug1: Connection established. debug1: identity file /Users/jsoref/.ssh/id_rsa type 0 debug1: identity file /Users/jsoref/.ssh/id_rsa-cert type -1
type 0 means it found a file, the
type -1 means it didn’t find a file. For me, it searches through a whole bunch of potential files. It’s possible to configure things with an
IdentityFile config directive which overrides the default search.
You can see that the log output mentions it found config some config sections and applied their settings.
Personally, I’d look at
host github.com and
host * sections. (The log output even tells me which line numbers the sections are on.)
Here are mine:
Host * ServerAliveInterval 15 ServerAliveCountMax 50 XAuthLocation /opt/X11/bin/xauth
host github.com RequestTTY no user git
user git line is why I can omit
git@ in the above.
You could also do:
ls -l ~/.ssh/id_*
That would show you which files you have (with standardish names). The
.pub files are the public keys that correspond to the private keys (w/o the