[英]How do I run win32-openssh through the powershell? (installed with install-package from chocolatey provider)
So I am just trying to convert to powershell from bash. 所以我只是想从bash转换为powershell。 I was trying to find a way to SSH my server, and found out I could install win32-openssh to do so.
我试图找到一种方法来对我的服务器进行SSH,发现可以安装win32-openssh来这样做。
I installed it by: 我通过以下方式安装它:
Installing chocolatey as packageprovider using: 使用以下命令将Chocolatey作为packageprovider安装:
install-packageprovider chocolatey 安装程序包提供商巧克力
Then i installed win32-openssh with the command: 然后我使用以下命令安装了win32-openssh:
install-package win32-openssh 安装软件包win32-openssh
My problem is now, how do I run this program? 我的问题是,现在如何运行该程序?
It installs the correct binaries etc. It will not add some PS cmdlets for the use off ssh inside PS. 它会安装正确的二进制文件等。不会在PS内的ssh中添加一些PS cmdlet以供使用。
It is all described on the package site : 所有内容都在打包站点上进行了描述:
This package performs the following operations that you normally have to hack at until you get what you want:
该程序包执行通常必须进行的以下操作,直到获得所需的内容为止:
- Install Appropriate Bitness for the version of Windows
为Windows版本安装适当的位数
- Install to Program Files (malware protection and following advice of dev team)
安装到程序文件(恶意软件保护和开发人员的建议)
- Add SSH location to System PATH
将SSH位置添加到系统路径
- Optionally install sshd windows service (Requires parameter - see below)
(可选)安装sshd Windows服务(Requires参数-参见下文)
- Optionally install sshd server "key based authentication" (Requires parameter - see below)
(可选)安装sshd服务器“基于密钥的身份验证”(需要参数-参见下文)
- Cleanly uninstall all of the above (removing config files and server keys requires special switch - see below)
干净地卸载所有上述内容(删除配置文件和服务器密钥需要特殊的开关-参见下文)
So you can run it from start menu, or by typing ssh.exe
into a prompt. 因此,您可以从开始菜单运行它,也可以在提示符下键入
ssh.exe
来运行它。
You have Two Options I can think of. 您有两个我能想到的选择。
Steps : 脚步 :
Pre-requisite : PC running Windows 10 . 先决条件:运行Windows 10的 PC。 Open PowerShell in Admin mode .
在Admin模式下打开PowerShell 。
Find-Module PoSH-SSH
type 'Y' for the prompts. 在提示中输入“ Y”。
Install-Module Posh-SSH
type 'A' for the prompts. 提示时输入“ A”。
Reference: https://www.thomasmaurer.ch/2016/04/using-ssh-with-powershell/ 参考: https : //www.thomasmaurer.ch/2016/04/using-ssh-with-powershell/
There's not really a need for this. 确实没有必要。 If you have git installed on your Windows machine, you can add it's usr/bin folder to you path.
如果您在Windows计算机上安装了git,则可以将它的usr / bin文件夹添加到您的路径中。 It has ssh and other Unix tools you can use just like in Bash in PowerShell or CMD.
它具有ssh和其他Unix工具,您可以像在PowerShell或CMD中的Bash中一样使用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.