SSH: key, agent, keychain

以前遇到过一个问题,在用有些 Linux 发行版时,用 ssh-keygen 产生好了密钥对并上传到了目标服务器,但每次登录都要重新输入。

这与 ssh-agent 有关,看如下 man ssh-agent 的输出:

ssh-agent is a program to hold private keys used for public key authentication (RSA, DSA). The idea is
that ssh-agent is started in the beginning of an X-session or a login session, and all other windows or
programs are started as clients to the ssh-agent program. Through use of environment variables the agent
can be located and automatically used for authentication when logging in to other machines using ssh(1).

时间: 2024-08-03 03:55:41

SSH: key, agent, keychain的相关文章

(诊断)为GitHub添加SSH key时出现“Could not open a connection to your authentication agent”错误的应对方案(转)

在为windows 环境下的github账户添加SSH key时,需要在Git Bash执行如下命令: 第一步:检查已有的SSH keys $ ls -al ~/.ssh 第二步:生成新的SSH key $ ssh-keygen -t rsa -C "[email protected]" # Creates a new ssh key, using the provided email as a label # Generating public/private rsa key pai

【转】同一台电脑关于多个SSH KEY管理

原文链接 http://yijiebuyi.com/blog/f18d38eb7cfee860c117d629fdb16faf.html 使用环境:关于同一台电脑LInux系统下使用多个SSH key 切换使用(或者多用户使用ssh提交代码) 要求,可以创建不同的 PUBLIC KEY ,根据下面步骤设置. (1)比如有aaa,bbb,ccc 三个帐号需要生成不同的 PUBLIC KEY $ ssh-keygen -t rsa Generating public/private rsa key 

Mac下一台电脑管理多个SSH KEY(转)

一.关于ssh是什么?http://www.ruanyifeng.com/blog/2011/12/ssh_remote_login.html 二.需求:一台电脑上(Mac os)管理多个ssh key,可以任意切换,达到多用户(账号)使用不同ssh提交代码.以下利用gerrit和github账号来做例子. 1)生成ssh key ssh-keygen -t rsa -C "[email protected]" 若一路回车(密码可以不写),这样只会在~/.ssh/ 目录下生成 id_r

多github帐号的SSH key切换

我有两个github帐号,一个是个人所用,一个是为公司项目所用.如果是单用户(single-user),很方便,默认拿id_rsa与你的github服务器的公钥对比:如果是多用户(multi-user)如user1,user2,那么就不能用在user2的身上了,这个时候就要配置一下了: 1.新建user2的SSH Key #新建SSH key: $ cd ~/.ssh # 切换到C:\Users\Administrator\.ssh ssh-keygen -t rsa -C "[email pr

CentOS7上GitHub/GitLab多帐号管理SSH Key

由于公司团队使用 GitLab 来托管代码,同时,个人在 Github 上还有一些代码仓库,可公司邮箱与个人邮箱是不同的,由此产生的 SSH key 也是不同的,这就造成了冲突 ,文章提供此类问题的解决方案:如何在一台机器上面同时使用 Github 与 Gitlab 的服务? 1. 生成GitHub/GitLab 的 SSH Key $ ssh-keygen -t rsa -f ~/.ssh/id_rsa_github -C "[email protected]" $ ssh-keyg

windows git ssh key for github

第一:检查.ssh是否存在(ls -al ~/.ssh) $ ls -al ~/.ssh Lists the files in your .ssh directory, if they exist 第二:产生新的SSH key(ssh-keygen -t rsa -C "[email protected]") $ ssh-keygen -t rsa -C "[email protected]" Creates a new ssh key, using the pro

windows下生成github ssh key详解

一.引子: 什么是ssh:ssh是Secure Shell(安全外壳协议)的缩写,建立在应用层和传输层基础上的安全协议.为了便于访问github,要生成ssh公钥,这样就不用每一次访问github都要输入用户名和密码. 二.生成条件: 请在github上先注册账号,本地安装git. 三.生成步骤: 1.本地成功安装了git后,单击鼠标右键,选择Git Bush here,打开git bush. 2. 键入命令:ssh-keygen -t rsa -C "[email protected]&quo

github ssh key Key is invalid. Ensure you've copied the file correctly解决办法

此错误出现原因是:在github上添加新key时,不正确到拷贝了~/.ssh/id_rsa.pub内容所致.一般发生在linux下,因为windows下用notepa++打开这个文件并复制一般是没有问题的,而linux下使用vim打开再复制就会因为vim添加了回车而导致key添加失败.解决办法是:使用cat命令将.ssh/id_rsa.pub内容输出到终端,再拷贝. Check for SSH keys ls -al ~/.ssh # Lists the files in your .ssh d

一台机器上~/.ssh/文件夹内如何管理多个ssh key

刚刚接触github,按照廖国锋的教程http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000 第一次操作ssh key那里,没问题. 然而,老师的新项目,不在github.com上,挂在coding.net上,于是在coding.net上又要设置ssh key. 于是,出现了一系列问题,其本质原因就是coding.net读取了原来的专属用于github的~/.ssh/id_rsa: 而我