git ssh-keygen' 未被识别为内部或外部命令
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10146398/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ssh-keygen' is not recognized as an internal or external command
提问by pal4life
I am trying to add ssh keys for usage on github but on my xp on command prompt ssh-keygen does not work. It gives me the following error
我正在尝试添加 ssh 密钥以在 github 上使用,但在我的 xp 上命令提示符 ssh-keygen 不起作用。它给了我以下错误
ssh-keygen' is not recognized as an internal or external command.
Is there an alternative for generating keys on xp?
是否有在 xp 上生成密钥的替代方法?
采纳答案by kini
Are you running msysgit, or some other form of Windows git installation? msysgit is only one possible way to run git on Windows but it's probably also the simplest one. It's also the way recommended by the git website at http://git-scm.org/.
您是在运行msysgit还是其他形式的 Windows git 安装?msysgit 只是在 Windows 上运行 git 的一种可能方法,但它可能也是最简单的一种。这也是 git 网站http://git-scm.org/推荐的方式。
If you areusing msysgit, then you need to run the command in Git Bash, not in a standard Windows command line prompt. Git Bash is a prompt that is installed for you by msysgit, and is basically the most common Linux command line shell (bash) packaged for Windows to facilitate command line usage of git. msysgit should also install the ssh-keygen program in a place where it is accessible from Git Bash, but not necessarily from your usual Windows command line prompt.
如果您正在使用msysgit,那么你需要运行的Git Bash的命令,而不是在一个标准的Windows命令行提示符。Git Bash是msysgit为你安装的一个提示符,基本上是为Windows打包的最常用的Linux命令行shell(bash),方便git的命令行使用。msysgit 还应该将 ssh-keygen 程序安装在一个可以从 Git Bash 访问的地方,但不一定是从你常用的 Windows 命令行提示符。
回答by ajknzhol
STEP 1Install Git.
步骤 1安装Git。
STEP 2Add the path of your gitto the environment variables like this C:\Program Files (x86)\Git\bin.
步骤 2将您的git路径添加到环境变量中,例如C:\Program Files (x86)\Git\bin。
STEP 3Open new terminal session and try ssh-keygen. It will work.
步骤 3打开新的终端会话并尝试ssh-keygen。它会起作用。
NOTENew Terminal Window is must!
注意新的终端窗口是必须的!
回答by ScottLenart
If you previously installed Git, open a git-bash and try the command from there.
如果您之前安装了 Git,请打开 git-bash 并从那里尝试命令。
回答by Daniel Sunaryo
Search your git directory if you already install git
如果您已经安装了 git,请搜索您的 git 目录
Use git bash should be on your C:\Program Files\Git\bin depend on your installation location
使用 git bash 应该在你的 C:\Program Files\Git\bin 取决于你的安装位置
If you already add the path just run shon your cmdor open sh.exe
如果您已经添加了路径,只需在您的cmd上运行sh或打开sh.exe
type ssh-keygen
键入ssh-keygen
Then just insert name and passphrase (You can just type empty string).
然后只需插入名称和密码(您可以只输入空字符串)。
回答by Arif Acar
for all windows os
适用于所有 Windows 操作系统
cd C:\Program Files (x86)\Git\bin
ssh-keygen
回答by Mansi
Running git bash as an admin worked for me!
以管理员身份运行 git bash 对我有用!
回答by Kondal Kolipaka
- Install msysgit
- Right-click on any file
- Select "Select Git Bash here" from menu
- Run ssh-keygencommand from a git bash terminal
- 安装 msysgit
- 右键单击任何文件
- 从菜单中选择“在此处选择 Git Bash”
- 从 git bash 终端运行ssh-keygen命令
回答by Sotos
if you run from cmd on windows check the path System Variable value must have inside C:\Program Files\Git\bin or the path of you git installation on cmd type set to see the variables
如果您在 Windows 上从 cmd 运行,请检查路径 System Variable value must have inside C:\Program Files\Git\bin 或您在 cmd 上安装 git 的路径类型设置以查看变量
回答by thezboe
ssh-keygen is a utility usually found on Linux distributions. You can use Cygwin on Windows to have most functionality of the Linux command line available to you.
ssh-keygen 是一个通常在 Linux 发行版中找到的实用程序。您可以在 Windows 上使用 Cygwin 来获得 Linux 命令行的大部分功能。