Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

generating SSH key for github: "zsh: command not found: $"

I'm trying to configure github with my macOS system. I use iTerm and zsh. When I try to generate a new ssh key according to the instructions from the https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key I get an error "zsh: command not found: $". Please help.

like image 358
mentol Avatar asked Dec 23 '22 19:12

mentol


2 Answers

$ is what you see in sh. In zsh you probably see [path@user] $ or something like that. You just mustn't copy this dollar sign. What you copy should by ONLY:

ssh-keygen -t rsa -b 4096 -C "[email protected]"
like image 107
miszcz2137 Avatar answered Dec 25 '22 09:12

miszcz2137


Runing it in bash instead works for me exec bash then ssh-add -K ~/.ssh/id_ed25519

And you can switch back to zsh by exec zsh

like image 33
Lucinda Zhao Avatar answered Dec 25 '22 09:12

Lucinda Zhao