如何在 Windows 上将 ssh 添加到 PATH?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8565804/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 09:02:22  来源:igfitidea点击:

How do I exactly add ssh to PATH on windows?

windowssshconfiguration

提问by Leahcim

When trying to connect to Github on a new (I'm the first to try) Windows work computer, I'm getting this error:

尝试在新的(我是第一个尝试的)Windows 工作计算机上连接到 Github 时,出现此错误:

permission denied (Public Key)

权限被拒绝(公钥)

Following instructions on Github, I then tried

按照 Github 上的说明,然后我尝试

ssh -vT [email protected]

This told me that

这告诉我

ssh is not recognized as an internal or external command, operable program or batch file

ssh 不是内部或外部命令,也不是可运行的程序或批处理文件

Googling that, I found out that this message means "ssh is not in the PATH".

谷歌搜索,我发现这条消息意味着“ssh不在路径中”。

Trying to add it to my path, I found

尝试将其添加到我的路径中,我发现

Variable name: Path
Variable value: :\Program Files (x86)\Windows Live\Shared

What exactlydo I enter to add ssh to the path. I'm not sure if it's

到底要输入什么才能将 ssh 添加到路径中。我不确定是不是

:\Program Files (x86)\Windows Live\Shared\ssh.exe

or something else...

或者是其他东西...

采纳答案by Robert Allan Hennigan Leahy

You need to locate the directory that ssh.exeis in.

您需要找到ssh.exe所在的目录。

You then need to go into System Properties (hit WINDOWS KEY+PAUSE), go to Advanced system settings, click Environment Variables...

然后你需要进入系统属性(点击WINDOWS KEY+PAUSE),进入高级系统设置,点击环境变量...

Scroll down in the scrolling window at the bottom, until you see "Path" under "Variable". Click it, click Edit...

在底部的滚动窗口中向下滚动,直到在“变量”下看到“路径”。单击它,单击编辑...

Go to the end of the value, add a semi-colon if one isn't there already, and type the path to the directory that ssh.exeis in.

转到值的末尾,如果还没有分号,请添加一个分号,然后键入ssh.exe所在目录的路径。

回答by Deepak Ramesh

SSH.exe will be in C:\Program Files\Git\usr\bin

SSH.exe 将在 C:\Program Files\Git\usr\bin

回答by M.Hassan

If Git for windows is installed,Bashshell is installed with sshand others.

如果安装了适用于 Windows 的 Git,则Bashshellssh与其他人一起安装。

You can run ssh from within Bash:

您可以在 Bash 中运行 ssh:

From the Command Prompt run the command:

从命令提示符运行命令:

bash -c "ssh -vT [email protected]"

Bash shell is aware of the path of ssh.

Bash shell 知道 ssh 的路径。

No need to add path of ssh in path environment.

无需在路径环境中添加 ssh 路径。

回答by H.A

Here is the answer:

这是答案:

Install the PUTTYand go to: C:\Program Files\PuTTY, copy the icon "putty" and paste to C:\WINNT\system32. Done.

安装PUTTY并转到:C:\Program Files\PuTTY,复制图标“腻子”并粘贴到 C:\WINNT\system32. 完毕。

Click> start> Run> PUTTY& hit Enter.

单击> start> Run>PUTTY并点击Enter