简体   繁体   English

为 github 生成 SSH 密钥:“zsh:找不到命令:$”

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

I'm trying to configure github with my macOS system.我正在尝试使用我的 macOS 系统配置 github。 I use iTerm and zsh.我使用 iTerm 和 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: $".当我尝试根据https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it中的说明生成新的 ssh 密钥时-to-the-ssh-agent#generating-a-new-ssh-key我收到错误“zsh:找不到命令:$”。 Please help.请帮忙。

$ is what you see in sh. $是您在 sh 中看到的内容。 In zsh you probably see [path@user] $ or something like that.在 zsh 中,您可能会看到[path@user] $或类似的东西。 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"

Runing it in bash instead works for me exec bash then ssh-add -K ~/.ssh/id_ed25519在 bash 中运行它对我exec bash然后ssh-add -K ~/.ssh/id_ed25519

And you can switch back to zsh by exec zsh你可以通过exec zsh

avoid copying dollar sign while generation ssh keys.避免在生成 ssh 密钥时复制美元符号。 use this ----> ssh-keygen -t rsa -b 4096 -C "your_email@example.com"使用这个----> ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM