当前位置:   article > 正文

windows ssh命令_如何启用和使用Windows 10的新内置SSH命令

apt.hw1b.site
windows ssh命令

windows ssh命令

Microsoft announced it was bringing an integrated OpenSSH client to Windows in 2015. They’ve finally done it, and an SSH client is hidden in Windows 10’s Fall Creators Update. You can now connect to an Secure Shell server from Windows without installing PuTTY or any other third-party software.

微软宣布将在2015年将集成的OpenSSH客户端引入Windows。他们终于做到了,并且SSH客户端隐藏在Windows 10的Fall Creators Update中 。 现在,您可以从Windows 连接到Secure Shell服务器 ,而无需安装PuTTY或任何其他第三方软件。

Update: The built-in SSH client is now enabled by default in Windows 10’s April 2018 Update. Here’s how to get the update if you don’t already have it on your PC.

更新  Windows 10的2018年4月更新默认情况下已启用内置SSH客户端。 如果您的PC上没有更新 ,请按以下方法获取更新

PuTTY may still have more features. According to the project’s bug tracker on GitHub, the integrated SSH client only supports ed25519 keys at the moment.

腻子可能仍然具有更多功能。 根据该项目在GitHub上的错误跟踪器,集成的SSH客户端目前仅支持ed25519密钥。

如何安装Windows 10的SSH客户端 (How to Install Windows 10’s SSH Client)

The SSH client is a part of Windows 10, but it’s an “optional feature” that isn’t installed by default.

SSH客户端是Windows 10的一部分,但它是默认未安装的“可选功能”。

To install it, head to Settings > Apps and click “Manage optional features” under Apps & features.

要安装它,请前往“设置”>“应用程序”,然后在“应用程序和功能”下单击“管理可选功能”。

Click “Add a feature” at the top of the list of installed features. If you already have the SSH client installed, it will appear in the list here.

单击已安装功能列表顶部的“添加功能”。 如果您已经安装了SSH客户端,它将显示在此处的列表中。

Scroll down, click the “OpenSSH Client (Beta)” option, and click “Install”.

向下滚动,单击“ OpenSSH Client(Beta)”选项,然后单击“安装”。

Windows 10 also offers an OpenSSH server, which you can install if you want to run an SSH server on your PC. You should only install this if you actually want to run a server on your PC and not just connect to a server running on another system.

Windows 10还提供了OpenSSH服务器,如果要在PC上运行SSH服务器,则可以安装该服务器。 仅当您确实要在PC上运行服务器而不是仅连接到在另一系统上运行的服务器时,才应安装此程序。

如何使用Windows 10的SSH客户端 (How to Use Windows 10’s SSH Client)

You can now use the SSH client by running the ssh command. This works in either a PowerShell window or a Command Prompt window, so use whichever you prefer.

现在,您可以通过运行ssh命令来使用SSH客户端。 它可以在PowerShell窗口或命令提示符窗口中工作,因此请使用您喜欢的任何一种。

To quickly open a PowerShell window, right-click the Start button or press Windows+X and choose “Windows PowerShell” from the menu.

要快速打开PowerShell窗口,请右键单击“开始”按钮或按Windows + X,然后从菜单中选择“ Windows PowerShell”。

To view the syntax of the ssh command, just run it:

要查看ssh命令的语法,只需运行它:

ssh

If you see an error message saying the command isn’t found, you will need to sign out and sign in again. Rebooting your PC will also work. This shouldn’t be necessary, but this is a beta feature.

如果看到错误消息,提示找不到该命令,则需要注销并重新登录。 重新启动PC也可以。 这不是必需的,但这是一个beta功能。

This command works the same as connecting to an SSH server via the ssh command on other operating systems like macOS or Linux. Its syntax, or command line options, are the same.

此命令的作用与在其他操作系统(例如macOS或Linux)上通过ssh命令连接到SSH服务器的作用相同。 其语法或命令行选项相同。

For example, to connect to an SSH server at ssh.example.com with the username “bob”, you’d run:

例如,要使用用户名“ bob”连接到ssh.example.com上的SSH服务器,请运行:

ssh bob@ssh.example.com

By default, the command attempts to connect to an SSH server running on port 22, which is the default. However, you may need to connect to a server running on a different port. You do this by specifying a port with the -p switch. For example, if the server accepts connections on port 7777, you’d run:

默认情况下,该命令尝试连接到默认端口22上运行的SSH服务器。 但是,您可能需要连接到在其他端口上运行的服务器。 通过使用-p开关指定端口来执行此操作。 例如,如果服务器在端口7777上接受连接,则可以运行:

ssh bob@ssh.example.com -p 7777

As with other SSH clients, you’ll be prompted to accept the host’s key the first time you connect. You’ll then get a command-line environment you can use to run commands on the remote system.

与其他SSH客户端一样,首次连接时,系统会提示您接受主机的密钥。 然后,您将获得一个命令行环境,可用于在远程系统上运行命令。

翻译自: https://www.howtogeek.com/336775/how-to-enable-and-use-windows-10s-built-in-ssh-commands/

windows ssh命令

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/99374
推荐阅读
相关标签
  

闽ICP备14008679号