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.
Asked
Active
Viewed 1.6k times
8
-
Does this answer your question? ['$' is not recognized as an internal or external command](https://stackoverflow.com/questions/41915762/is-not-recognized-as-an-internal-or-external-command) – jplatte Mar 01 '20 at 22:40
-
This is a valid problem. I ran this into myself on a fresh OS installation on Macbook. My first step was to ssh from default terminal. Well, Macbook M1 has Rosetta for that support. First ssh timed out so it is supported. As soon as I followed the steps in the guide it blowed away! `zsh: command not found: ssh` – HalfWebDev Dec 13 '20 at 19:27
-
I am wondering @mentol if you solved this? – HalfWebDev Dec 13 '20 at 19:28
3 Answers
17
$
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 "your_email@example.com"

miszcz2137
- 894
- 6
- 18
4
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

Lucinda Zhao
- 41
- 2
-
1Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 28 '21 at 19:53
-1
avoid copying dollar sign while generation ssh keys. use this ----> ssh-keygen -t rsa -b 4096 -C "your_email@example.com"