本文翻译自:SSH Key - Still asking for password and passphrase

I've been somewhat 'putting up' with Github always asking for my username and password when I clone a repository. 当我克隆存储库时,我一直在“忍受”Github总是询问我的用户名和密码。 I want to bypass this step because it is an annoyance within my workflow. 我想绕过这一步,因为这是我工作流程中的一个烦恼。

I tried setting up an SSH key (which I successfully did) using this guide. 我尝试使用本指南设置SSH密钥(我成功完成了)。 https://help.github.com/articles/generating-ssh-keys and I was successful. https://help.github.com/articles/generating-ssh-keys我成功了。

My problem is that I am still asked for my github password and passphrase when cloning a repository (using SSH). 我的问题是,在克隆存储库时(使用SSH),我仍然被要求输入我的github密码和密码。 My understanding was that after I set up this SSH key, I would no longer have to do that. 我的理解是,在设置了这个SSH密钥后,我不再需要这样做了。

I am a little unsure what to ask, so I will just state my goal. 我有点不确定要问什么,所以我只是陈述我的目标。

I want to be able to clone repositories without having to put in my Github information all the time . 我希望能够克隆存储库而无需一直输入我的Github信息

What am I missing with my SSH key? 我的SSH密钥丢失了什么? If anyone can provide some guidance or resources I would appreciate it, because I've always felt a little lost when it came to SSH authentication in GitHub. 如果有人可以提供一些指导或资源,我会很感激,因为在GitHub中进行SSH身份验证时,我总是感到有些失落。

From my knowledge, this is a command that tests if things are working properly, here are the output from my console: 据我所知,这是一个测试事情是否正常工作的命令,这是我控制台的输出:

~ $ ssh -T git@github.com
Saving password to keychain failed
Enter passphrase for key '/Users/MYNAME/.ssh/id_rsa':
Hi MYNAME! You've successfully authenticated, but GitHub does not provide shell access.

When I input my password, should that fail first? 当我输入密码时,首先应该失败吗? Then, when I enter my passphrase, it passes. 然后,当我输入我的密码时,它会通过。


#1楼

参考:https://stackoom.com/question/1QVmo/SSH密钥-仍然要求输入密码和密码


#2楼

If you work with HTTPs urls, it'll always ask for your username / password. 如果您使用HTTPs网址,它将始终询问您的用户名/密码。

If you're correctly using SSH when cloning / setting remotes. 如果您在克隆/设置遥控器时正确使用SSH Then make sure you have a ssh-agent to remember your password. 然后确保你有一个ssh-agent来记住你的密码。 That way, you'll only enter your passphrase once by terminal session. 这样,您只需通过终端会话输入一次密码。

If it is still too annoying, then simply set a ssh-key without passphrase. 如果它仍然太烦人,那么只需设置一个没有密码短语的ssh-key。


#3楼

尝试使用ssh-agent因为它在那里解释: https : //help.github.com/articles/working-with-ssh-key-passphrases


#4楼

Add Identity without Keychain 添加没有钥匙串的身份

There may be times in which you don't want the passphrase stored in the keychain, but don't want to have to enter the passphrase over and over again. 有时您可能不希望密码链中存储密码,但不希望一遍又一遍地输入密码。

You can do that like this: 你可以这样做:

ssh-add ~/.ssh/id_rsa

This will ask you for the passphrase, enter it and it will not ask again until you restart. 这将要求您输入密码,输入密码,直到重新启动它才会再次询问。

Add Identity Using Keychain 使用钥匙串添加身份

As @dennis points out in the comments, to persist the passphrase through restarts by storing it in your keychain, you can use the -K option ( -k for Ubuntu) when adding the identity like this: 正如@dennis在评论中指出的那样,要通过将密码存储在钥匙串中来重新启动密码,您可以在添加如下身份时使用-K选项( -k用于Ubuntu):

ssh-add -K ~/.ssh/id_rsa

Once again, this will ask you for the passphrase, enter it and this time it will never ask again for this identity. 再次,这将要求您输入密码,输入密码,这次它永远不会再询问此身份。


#5楼

如果您使用ssh url for git,当提示输入ssh的密码时,将用户名设置为“ git ”,将密码作为系统的登录密码


#6楼

I already had set a passphrase but for some reason it wouldn't recognize it anymore. 我已经设置了一个密码,但由于某种原因它不再能识别它。 So I just added the identity file to my keychain again using ssh-add -K and it stopped asking for my password. 所以我刚刚使用ssh-add -K将身份文件添加到我的钥匙串中,并且它停止询问我的密码。

SSH密钥 - 仍然要求输入密码和密码相关推荐

  1. 密钥生成并配置_如何在 CentOS 8 上设置 SSH 密钥

    本文最先发布在: 如何在 CentOS 8 上设置 SSH 密钥​www.itcoder.tech 安全 Shell (SSH) 是一个被设计用来在客户端和服务器之间进行安全连接的加密网络协议. 最流 ...

  2. 腾讯云服务器使用ssh密钥登录--个人常遇到问题均解决

    什么是SSH密钥对 SSH密钥是一种无须密码登录Linux实例的认证方式. 通过加密方法生成一对SSH密钥,一个对外公开密钥,成为公钥,一个由您保密保存,称为私钥. 将公钥存放于您的Linux实例中, ...

  3. linux 取消证书登录密码,SUSELinux 中为 SSH 访问设置不输入密码的证书认证登录方式...

    SSH Client :linux-gxnt SSH Server :xxzx-rdb 目的: linux-gxnt 上的 nagios 用户以相同的用户(nagios)SSH 登录 xxzx-rdb ...

  4. CentOS6.9下ssh密钥登录配置步骤(免密码登录)和ssh-keygen 命令常用参数

    密钥登录步骤(免密码登录) ssh登录提供两种认证方式:口令(密码)认证方式和密钥认证方式.其中口令(密码)认证方式是我们最常用的一种,出于安全方面的考虑,介绍密钥认证方式登录到linux/unix的 ...

  5. 在Linux系统下更改或更新SSH密钥密码的方法

    本文介绍如何在Linux系统下更新或更改SSH密钥密码,也适用在Unix系统中.SSH密钥通常用于向某些信息系统的用户进行身份验证,SSH密钥本身是私钥,使用从密码短语导出的对称加密密钥进一步加密私钥 ...

  6. Git不断询问我ssh密钥密码

    本文翻译自:Git keeps asking me for my ssh key passphrase I created keys as instructed in the github tutor ...

  7. ssh密钥登录 改密码登录_如何使用密钥对通过SSH登录而不使用密码

    ssh密钥登录 改密码登录 In last post we saw how to use Expect Script for login to remote server using SSH. The ...

  8. 【解决Git ssh 密钥忘记密码】

    前言 如果在之前有创建SSH的时候设置过密码,那就很有可能git操作时出现忘记密码的尴尬情况. 今天我就忘记了密码,在网上找到了解决的方法就记录下来 解决 在ssh密码忘记密码我们是无法去修改的,这个 ...

  9. 重置 Amazon EC2 实例的密码和SSH 密钥

    关注公众号:AWS爱好者(iloveaws) 文 | 沉默恶魔(转载请注明出处) 网站:www.iloveaws.cn 今天参与了一个讨论,内容是在有AWS控制台根用户权限的情况下,能否重置 该账号下 ...

最新文章

  1. 如何写一篇好的技术博客
  2. linux编译安装git
  3. Why manually change will not trigger text determination case 2
  4. python 核心编程第5章(习题)
  5. 排序算法:冒泡排序算法优化实现及分析
  6. 使用 YOLOv5 训练自动驾驶目标检测网络
  7. 【Flask】ORM 关系一对一
  8. 本机与服务器、镜像机之间文件互传
  9. 三星1万亿元重金下注,推动AI、5G、半导体等项目的研究
  10. 李彦宏告诫年轻人:向前看两年
  11. CentOS安装QQ2012
  12. python大家都是怎么学的_你们都是怎么学 Python 的?
  13. python文本模糊匹配
  14. c 语言中的this指针,C++ this指针详解
  15. 腾讯视频qlv格式转换成mp4格式的的简单方法!
  16. 使用3D Max里面自带的门,怎么设置动画并预览
  17. Java工具类cntool
  18. 视觉和Lidar里程计SOTA方法一览!(Camera/激光雷达/多模态)
  19. JS基础并且和||或
  20. miui android mmi,MIUI Hidden Settings

热门文章

  1. android 多语言(在APP里面内切换语言)
  2. WinCE --- 调试RS485串口
  3. Visual Studio 2008 Service Pack 1 - BETA发布
  4. 关于phpexcel读取时间字段的格式不正确
  5. windows server2012在已有.net4.5框架的基础上安装.net3.5的方法
  6. MFCC/Filter Bank的提取流程
  7. Python数据分析与展示[第二周]
  8. [Yii2] 前台用户与后台用户分离
  9. 字符串的碎片整理。。。
  10. JavaScript 闭包介绍