在 Windows 10/11 中生成新的 ssh 密钥 [英] Generate new ssh keys in Windows 10 / 11

查看:74
本文介绍了在 Windows 10/11 中生成新的 ssh 密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在安装 Windows 10 后,我很难启动并运行 SSH 密钥.通常的方法是创建它并将其放入 .ssh 下的用户帐户中.但此文件夹在 Windows 10 中似乎不可用.

I am having a really hard time getting my SSH keys up and running after installing Windows 10. Normal method is create it and throw it in the user's account under .ssh. But this folder does not appear to be available in Windows 10.

对于不同的存储库,我需要 3 个 SSH 密钥.

I need to have 3 SSH keys for different repos.

推荐答案

  1. 打开 windows 命令行(在搜索框中键入cmd"并按 Enter).
  2. 它将默认为您的主文件夹,因此您无需cd 到另一个文件夹.
  3. 输入 ssh-keygen(如果没有找到,检查此处)
  4. 第一个参数留空(默认),如果你愿意,可以输入密码,或者留空
  5. 您的 ssh 密钥应存储在所选目录中,默认为:/c/Users/YourUserName/.ssh/id_rsa.pub
  1. Open the windows command line (type "cmd" on the search box and hit enter).
  2. It'll default to your home folder, so you don't need to cd to a different one.
  3. Type ssh-keygen(if not found, check here)
  4. Leave the first parameter empty(default), enter a password if you like, or leave it empty
  5. Your ssh keys should be stored at chosed directory, the default is: /c/Users/YourUserName/.ssh/id_rsa.pub

ps:如果你安装了带有 bash 集成的 git(像我一样)打开Git Bash"而不是cmd"第一步

p.s.: If you installed git with bash integration (like me) open "Git Bash" instead of "cmd" on first step

这篇关于在 Windows 10/11 中生成新的 ssh 密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆