windows ssh密钥

Do you have the need to work with SSH keys from Windows and you find that this becomes a hassle very quickly? HTG goes into how to make the process as transparent as possible, using The PuTTY package suite.

您是否需要使用Windows的SSH密钥,并且发现这很快变得很麻烦? HTG使用PuTTY软件包套件研究如何使过程尽可能透明。

Image by kaneda99.

图片由kaneda99提供。

总览 (Overview)

In this guide we’ll explain how to SSH to a Linux machine from Windows with your public key, using Putty & Winscp. In addition, we will enable the forwarding option. This will allow you to continue to jump from the machine you’ve connected to with your key, to another machine that supports SSHing with keys. We will not go into how to put your public key on the Linux machine, as we have already covered this topic.

在本指南中,我们将说明如何使用Putty&Winscp使用公用密钥从Windows SSH到Linux计算机。 此外,我们将启用转发选项。 这样一来,您就可以继续从使用密钥连接的计算机跳到另一台支持使用密钥进行SSH加密的计算机。 因为我们已经讨论了这个主题,所以我们不会讨论如何将您的公钥放置在Linux机器上。

Install basic programs/packages

安装基本程序/软件包

  • Obtain the PuTTY package (not just the executable) and install it.

    获取PuTTY软件包(不仅仅是可执行文件)并安装。

  • Optionally obtain the programs WinSCP and mRemote, and install them.

    (可选)获取程序WinSCP和mRemote ,然后安装它们。

生成密钥对 (Generate a Key pair )

If you haven’t created a key pair yet, and you want to do it from the comfort of your Windows desktop, you can use “PuTTY Key Generator” which was installed as part of the “PuTTY package“:

如果尚未创建密钥对,并且想要在Windows桌面上舒适地使用它,则可以使用作为“ PuTTY软件包”的一部分安装的“ PuTTY密钥生成器”:

  • Open “PuTTY Key Generator” by going into “Start” -> “PuTTY” -> “PuTTYgen”进入“开始”->“ PuTTY”->“ PuTTYgen”,打开“ PuTTY Key Generator”
  • While not required, it is recommended that you change the length of your key from the default 1024. Change the number of “bits” at the bottom from “1024” to “4096”.虽然不是必需的,但建议您将密钥的长度从默认的1024更改。将底部的“位数”数量从“ 1024”更改为“ 4096”。
  • Click “Generate” and move your mouse around randomly until the bar reaches 100%. This “salts” your key, so try to make your mouse movements as random as possible.

    单击“生成”,然后随机移动鼠标,直到条达到100%。 这会“盐化”您的按键,因此请尝试使鼠标的移动尽可能随机。

  • Once the program is done generating the key,程序生成密钥后,
  • On the “Key Comment” line, change it to be something more useful like your name. For example:

    在“关键评论”行上,将其更改为更有用的名称,例如您的名字。 例如:

  • While not required, it is highly recommended that you set a passphrase on the private key. This will protect your private key in case some one gains access to it and you will only be bothered with entering once at machine boot up, if you perform all the steps in the guide.虽然不是必需的,但强烈建议您在私钥上设置密码。 如果您执行了本指南中的所有步骤,这将保护您的私钥,以防万一有人可以访问它,并且只有在计算机启动时才输入一次即可。
  • Click on “Save private key”.点击“保存私钥”。
Note: If you already have a saved private key, you can “extract” the public portion by “load”ing it with the generator.
注意:如果您已经有保存的私钥,则可以通过将生成器“加载”到公共部分来“提取”公共部分。

配置关键军需官 (Configuring the Key-quartermaster)

The “Pageant” program that was installed as part of the PuTTY package, can store your key/s and give them to mRemote, WinSCP and PuTTY as required.

作为PuTTY软件包的一部分安装的“ Pageant”程序可以存储您的密钥,并根据需要将其提供给mRemote,WinSCP和PuTTY。

  • Open “Pageant” from the start menu. (Note: it may run off to the system tray)

    从开始菜单中打开“选美”。 (注意:它可能会流到系统托盘上)

  • If it has run off to the system tray, double click it, to bring up the main window.如果它已经流到系统托盘,请双击它以打开主窗口。
  • Click “Add Key” and give it your saved Key Pair.

    单击“添加密钥”,然后将其保存为密钥对。

  • If need be, provide the passphrase.如果需要,请提供密码。

Done, from now on, Putty, WinSCP and any program that serves as a fronted for them (like mRemote) will first consult with the Pageant program if there is a key to use for the connection.

从现在开始,Putty,WinSCP和充当它们前端的任何程序(如mRemote)将首先与Pageant程序进行协商(如果有用于连接的密钥)。

Loading Keys automatically at startup (Optional)

启动时自动加载密钥(可选)

The process above needs to be repeated after every machine reboot, as Pageant doesn’t save loaded key configurations. To have it load the configuration automatically at startup, you can use one of the two methods below:

每次重新启动计算机后,都需要重复上述过程,因为Pageant不会保存已加载的密钥配置。 要使其在启动时自动加载配置,可以使用以下两种方法之一:

  1. Assuming you’ve allowed Pageant to take over the ppk suffix, you should be able to simply add the key files to the Windows “startup” folder.假设您已允许Pageant接管ppk后缀,则应该只需将密钥文件添加到Windows“启动”文件夹中即可。
  2. Create a shortcut to the program that passes the key-files as parameters.  For example, the “Target” command for two(2) keys would look like:

    创建一个将密钥文件作为参数传递的程序的快捷方式。 例如,用于两(2)个键的“目标”命令如下所示:

    “C:\Program Files (x86)\PuTTY\pageant.exe” “C:\Users\AviadR\Documents\aviad’s 4096.ppk”  “C:\Users\AviadR\Documents\aviad’s 1024.ppk

    “ C:\ Program Files(x86)\ PuTTY \ pageant.exe”“ C:\ Users \ AviadR \ Documents \ aviad的4096.ppk”“ C:\ Users \ AviadR \ Documents \ aviad的1024.ppk

  • Then, add this shortcut to window’s startup.然后,将此快捷方式添加到window的启动中。

Enable SSH Agent forwarding (PuTTY/mRemote)

启用S​​SH代理转发(PuTTY / mRemote)

This configuration is optional, but doing it will allow you once you’ve SSHed into a machine to continue and SSH from it, to the next machine, with the same key. To do this:

此配置是可选的,但是这样做可以使您在SSH进入一台计算机后继续操作,并使用相同的密钥从SSH到下一台计算机。 去做这个:

  • Open PuTTY.打开腻子。
  • Under “Connection” -> “SSH” -> “Auth”.在“连接”->“ SSH”->“身份验证”下。
  • Check the “Allow agent forwarding”.

    检查“允许代理转发”。

  • Go back to “Session”返回“会话”
  • Select the “Default Settings” entry.选择“默认设置”条目。
  • Click on “Save”.

    点击“保存”。

  • Done.做完了

Enable SSH Agent forwarding (WinSCP)

启用S​​SH代理转发(WinSCP)

  • In a WinSCP new connection tab, Enable the Advance options checkbox.在WinSCP的新连接选项卡中,启用高级选项复选框。
  • Go to the “SSH” -> “Authentication”.转到“ SSH”->“身份验证”。
  • Check the “Allow agent forwarding” checkbox.

    选中“允许代理转发”复选框。

  • Go to the “General Options” by clicking on “Preferences” -> “Preferences”.

    通过单击“首选项”->“首选项”转到“常规选项”。

  • Enable Putty to be invoked with the  forwarding option by going into “Integration” -> “Application” and appending the “-A” CLI option.

    通过进入“集成”->“应用程序”并附加“ -A” CLI选项,启用使用转发选项调用Putty的功能。

  • You can now make this the template for subsequent connections by going back to “Session” and typing in, the basic information that you know will be uniform across all connections (if any), like Username, IP, Etc’. Then “save” the session.现在,您可以返回“会话”并输入,从而将其作为后续连接的模板,您所知道的基本信息将在所有连接(如果有)中统一,例如用户名,IP,等等。 然后“保存”会话。
Author’s Notes 作者笔记
Ubuntu’s bug #1 “Microsoft has a majority desktop market share”, still holds true. maybe one day we’ll move to the Linux desktop completely, but that day will not be today and not for the Ubuntu的错误#1 “微软在台式机市场上占有多数”仍然成立。 也许有一天,我们将完全迁移到Linux桌面,但今天不是今天,也不是 35 year old shell. 35岁的Shell 。



Spike: So i guess i served my time and i’m free to go?
SoundWave: Free to go, to Cybertron…

Spike:所以我想我已经尽职了,我有空吗? SoundWave:可以自由去塞伯坦…

翻译自: https://www.howtogeek.com/125364/how-to-ssh-hop-with-key-forwarding-from-windows/

windows ssh密钥

windows ssh密钥_如何通过Windows从密钥转发进行SSH Hop相关推荐

  1. windows ssh代理_如何在Windows上通过SSH设置代理?

    windows ssh代理 This tutorial teaches how to set up SSH proxy on Linux. 本教程讲解如何在Linux上设置SSH代理 . How to ...

  2. windows防火墙规则_如何在Windows防火墙中创建高级防火墙规则

    windows防火墙规则 Windows' built-in firewall hides the ability to create powerful firewall rules. Block p ...

  3. windows设备管理器_如何打开Windows设备管理器?

    windows设备管理器 Windows Device Manager is used to list hardware and software devices in the current sys ...

  4. windows虚拟桌面_如何在Windows 10中使用虚拟桌面

    windows虚拟桌面 Windows 10 finally added virtual desktops as a built-in feature. If you keep a lot of ap ...

  5. python 操作 windows 控件_在中文windows下使用pywinauto进行窗口操作(一)

    这两天开始接触pywinauto,听说百度的自动化QA也用这个模块,于是来了兴趣,但网上的教程很少,而且基本上都是拿官方的notepad来说,首先中文菜单的支持是问题,其次各种操作也没有写清楚,阅读官 ...

  6. ssh 连接_怎样解决Linux环境下远程连接ssh速度慢的问题

    哈喽各位爱学习的小伙伴们,我最近遇到了一个ssh远程慢的问题,输入ssh后,需要等10+s才会出现密码验证的页面,通过 ssh ip -vv 查看,连接慢速的节点是DNS解析的过程,/etc/reso ...

  7. 查看windows登陆日志_如何在Windows登录屏幕上查看以前的登录信息

    查看windows登陆日志 By default, most versions of Windows record an event every time a user tries to log on ...

  8. windows中文字体_如何让 Windows 变「好看」?

    我想,大多数用 Windows 电脑的用户或多或少都曾羡慕过苹果 macOS 电脑简洁的桌面吧?至少我在换到 macOS 之前是羡慕的,并且曾多次尝试让自己的 Windows 电脑变得像 macOS ...

  9. windows 取色器_这款 Windows 10 官方「外挂」让你取色更便捷

    去年微软针对 Windows 10 系统重启了 PowerToys 工具,并且针对 Windows 10 系统特性推出了一系列的小工具来改善 Windows 10 的易用性. 时隔一年后的今天,这款工 ...

最新文章

  1. MyEclipse 9.x Professional/blue/spring/bling 下载与破解
  2. iOS开发拓展篇——如何把项目托管到GitHub
  3. EAR项目构建的几种方式
  4. 什么是xmlschema
  5. golang中如何抓取panic让程序正常退出
  6. Arm开发板+Qt学习之路-析构函数和对话框一起时
  7. 这里有一份面筋请查收(七)
  8. choiceformat_ChoiceFormat:数字范围格式
  9. 《精通Spring 4.x 企业应用开发实战》学习笔记
  10. Java Annotation认知(包括框架图、详细介绍、示例说明)
  11. php class variable,解决关于PHP“Undefined variable”变量未定义
  12. 关于node.js杂记
  13. fastjson反序列化map_最新fastjson反序列化漏洞分析
  14. php rc4对称加密函数,PHP实现的简单对称加密与解密方法实例小结
  15. 科学和工程中的信号处理
  16. 【Java】 大话数据结构(6) 栈的顺序与链式存储
  17. 头条的_signature这个如何_如何彻底防止反编译,dex加密怎么做
  18. 高等数学课后答案下册同济大学第七版
  19. 学英语查单词:快乐英语,简单生活,why not Bing EngKoo!?
  20. 【毕业设计】 stm32智能运动计步系统 - 物联网 嵌入式 单片机

热门文章

  1. 每日学术速递4.16
  2. 【模拟试题】德雷克的追捕
  3. 域分析工具BloodHound的使用
  4. 【软考备战·希赛网每日一练】2023年5月3日
  5. 凌晨GIS恭祝新春快乐
  6. 硬件大熊原创合集(2022/02更新)
  7. mustache 库机理
  8. 常见的pc开机报警声音
  9. c语言产生系统年月日,c语言中如何输入年月日
  10. 处理手机点击淘宝优惠链接提示“目标地址不可达”错误