多机使用SSH key连接至Github Page

在本地机器中安装好Git和Hexo之后,在终端或是Git Bash中执行如下代码:

12
git config --global user.name "YOUR NAME"  # Github注册账户名git config --global user.email "YOUR EMAIL ADDRESS"  # Github注册邮箱

验证Github

输入以下命令,生成SSH key:

1
ssh-keygen -t rsa -b 4096 -C "YOUR EMAIL ADDRESS"  # Github注册邮箱

将 SSH key 添加到 ssh-agent:

大专栏  多机使用SSH key连接至Github Page="line">123
eval "$(ssh-agent -s)"  # 开启 ssh-agentssh-add ~/.ssh/id_rsa  # 添加SSH key到 ssh-agentclip < ~/.ssh/id_rsa.pub  # 将SSH key复制出来

登录Github,依次点击自己的头像,SettingsSSH and GPG keysAdd SSH key, 在 Title 这里输入 Key 的label,我的是Linux-PC,将SSH key添加到Github账户。

然后测试SSH连接,在终端或Git Bash中执行:

1
ssh -T [email protected]

如果返回的是You’ve successfully authenticated, but GitHub does not provide shell access,那么就表示已经成功了。

原文地址:https://www.cnblogs.com/dajunjun/p/11712806.html

时间: 2024-08-01 05:22:36

多机使用SSH key连接至Github Page的相关文章

Win7下生成SSH Key连接Github--(MsysGit)

ls -al ~/.ssh # Lists the files in your .ssh directory, if they exist We strongly recommend using an SSH connection when interacting with GitHub. SSH keys are a way to identify trusted computers, without involving passwords. The steps below will walk

创建SSH Key连接github或gitlab

当我们从github或者gitlab上clone项目或者参与项目时,我们需要证明我们的身份.一种可能的解决方法是我们在每次访问的时候都带上账户名.密码,另外一种办法是在本地保存一个唯一key,在你的账户中也保存一份该key,在你访问时带上你的key即可.github.gitlab就是采用key来验证你的身份的,并且利用RSA算法来生成这个密钥. 链接方法 首先你需要在github上或者gitlab上有一个自己的账户 打开git bash,输入命令ls -al ~/.ssh.检查是否显示有id_r

How to generate ssh key only for github and not conflict with original key

3 生成SSH公钥 $ ssh-keygen -t rsa -C "[email protected]" #ssh-keygen -t dsa -C "[email protected]" # Creates a new ssh key using the provided email Generating public/private rsa key pair. Enter file in which to save the key (/home/you/.ssh

git ssh key创建和github使用

github拉代码需要ssh验证 git是分布式的代码管理工具,远程的代码管理是基于ssh的,所以要使用远程的git则需要ssh的配置. 一 .设置git: 设置git的user name和email: $ git config --global user.name "xxx" $ git config --global user.email "[email protected]" 查看git配置: $git config --lis 二.生成SSH密钥过程: 1.

多个github帐号的SSH key切换

一台电脑上有一个ssh key,在github上提交代码,由于其他原因 你可能会在一台电脑上提交到不同的github上,怎么办呢... 假设你电脑上一个ssh key都没有,如果有默认的一个了,请直接生成第二个 一.生成并添加第一个ssh key $ ssh-keygen -t rsa -C "[email protected]" 在Git Bash中执行命令一路回车,会在~/.ssh/目录下生成id_rsa和id_rsa.pub两个文件 用文本编辑器打开id_rsa.pub里的内容,

Github 之 SSH key的创建于配置(Windows)

最近配置了github的ssh key,翻找了大量资料后发现github官方就有相关的教程--在此翻译一下官方教程以加深印象 原文链接:https://help.github.com/categories/ssh/ Generating an SSH key(生成SSH key) SSH密钥是来识别值得信赖的电脑的方法.您可以生成一个SSH密钥,并按照本节所述的方法将公共密钥添加到您的帐户GitHub中. Checking for existing SSH keys(检查已存在的SSH key)

github入门:设置添加ssh key&lt;转&gt;

转自:http://blog.csdn.net/binyao02123202/article/details/20130891 很多朋友在用github管理项目的时候,都是直接使用https url克隆到本地,当然也有有些人使用 SSH url 克隆到本地.然而,为什么绝大多数人会使用https url克隆呢? 这是因为,使用https url克隆对初学者来说会比较方便,复制https url 然后到 git Bash 里面直接用clone命令克隆到本地就好了.而使用 SSH url 克隆却需要

使用ssh key的方式建立和git服务器的通信

1.以前大家好像都在用https的方式同git来同步代码,但是到了新公司后,主管说要配ssh key,所以大概了解一下 An SSH key allows you to establish a secure connection between your computer and GitLab(or github). ssh key就是为了让两个机器之间使用ssh不需要用户名和密码.具体实现的原理是 因为git可以在本机保存一个私钥,然后在git服务器上面填写你自己的公钥,这样你在使用git的命

gitLab添加ssh key

电脑新装了一台虚拟机,想要和gitLab建立一个安全的ssh连接,步骤如下 1.本机生成ssh key 系统环境:Linux 使用root用户登录,执行命令:ssh-keygen -t rsa -C "[email protected]",默认回车就ok了,该命令会创建一个隐藏的.ssh文件夹,文件夹中有2个文件:id_rsa(私钥)和id_rsa.pub(公钥),使用命令:vi id_rsa.pub查看公钥内容,复制公钥内容. 2.gitLab添加ssh key  3.授权 chmo