Home > Mobile >  Cannot push to github with SSH
Cannot push to github with SSH

Time:05-31

I'm trying to follow the steps recommended here:

https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account

(venv3) Admins-MacBook-Pro-4:learn_git bobsmith$ ssh-keygen -t ed25519 -C "[email protected]"
Generating public/private ed25519 key pair.
Enter file in which to save the key (/Users/bobsmith/.ssh/id_ed25519): skey
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in skey.
Your public key has been saved in skey.pub.

The key fingerprint is:
SHA256:zzzzzzzzzzzzpbpcHTQ5cDcKqSne8 [email protected]   (altered of course)
The key's randomart image is:

[deleted]

However when I run

(venv3) Admins-MacBook-Pro-4:learn_git bobsmith$ ls ~/.ssh
authorized_keys
authorized_keys copy
config
google_compute_engine
google_compute_engine.pub
google_compute_known_host original
google_compute_known_hosts
google_compute_known_hosts original copy
google_compute_known_hosts_copy
known_hosts
known_hosts copy
known_hosts original
kyle_aws_key.pem
ssh_key
ssh_key copy
ssh_key.pub
ssh_key.pub copy
ssh_key1
ssh_key1.pub

The file is not there.

I was not able to get the ssh-add command to work but I don't think that matters.

(venv3) Admins-MacBook-Pro-4:learn_git bobsmith$ ssh-add -K ~/.ssh/id_ed25519
/Users/bobsmith/.ssh/id_ed25519: No such file or directory
(venv3) Admins-MacBook-Pro-4:learn_git bobsmith$ ssh-add -K ~/.ssh/skey
/Users/bobsmith/.ssh/skey: No such file or directory
(venv3) Admins-MacBook-Pro-4:learn_git bobsmith$ ssh-add ~/.ssh/skey
/Users/bobsmith/.ssh/skey: No such file or directory
(venv3) Admins-MacBook-Pro-4:learn_git bobsmith$ open ~/.ssh
(venv3) Admins-MacBook-Pro-4:learn_git bobsmith$ ssh-add ~/.ssh/skey.pub
/Users/bobsmith/.ssh/skey.pub: No such file or directory
(venv3) Admins-MacBook-Pro-4:learn_git bobsmith$ ssh-add --apple-use-keychain ~/.ssh/skey
ssh-add: illegal option -- -

I could not generate the ssh key so I used:

(venv3) Admins-MacBook-Pro-4:learn_git bobsmith$ cat skey.pub
ssh-ed25519 [deleted] 

That generated the ssh key, but again I don't understand why the file skey.pub does not exist in the ssh file

I then posted the key into the proper place in my gihub account. When I run

(venv3) Admins-MacBook-Pro-4:learn_git bobsmith$ pbcopy < ~/.ssh/skey.pub
-bash: /Users/bobsmith/.ssh/skey.pub: No such file or directory

(venv3) Admins-MacBook-Pro-4:learn_git bobsmith$ ssh -T [email protected]
Warning: Permanently added the RSA host key for IP address '140.82.114.3' to the list of known hosts.
no such identity: /Users/bobsmith/.ssh/id_ed25519: No such file or directory
[email protected]: Permission denied (publickey).

And at that point I'm stuck.

CodePudding user response:

Did you try looking in the folder /Users/bobsmith/.ssh ?

CodePudding user response:

They don't make it clear on the instructions that you have to

cd ~/.ssh

Before you run

ssh-keygen -t ed25519 -C "[email protected]"
  • Related