如何在阿里阿里云code添加sshkey key

Github添加sshkey
时间: 10:13:45
&&&& 阅读:50
&&&& 评论:
&&&& 收藏:0
标签:&&&&&&SSH key
An SSH key allows you to establish a secure connection between your computer and GitLab.
Before generating an SSH key, check if your system already has one by running
cat ~/.ssh/id_rsa.pub
If you see a long string starting with ssh-rsa or ssh-dsa, you can skip the ssh-keygen step.
To generate a new SSH key, just open your terminal and use code below. The ssh-keygen command prompts you for a location and filename to store the key pair and for a password. When prompted for the location and filename, you can press enter to use the default.
It is a best practice to use a password for an SSH key, but it is not required and you can skip creating a password by pressing enter. Note that the password you choose here can’t be altered or retrieved.
Use the code below to show your public key.
cat ~/.ssh/id_rsa.pub
Copy-paste the key to the ‘My SSH Keys’ section under the ‘SSH’ tab in your user profile. Please copy the complete key starting with ssh- and ending with your username and host.
Use code below to copy your public key to the clipboard. Depending on your OS you’ll need to use a different command:
clip & ~/.ssh/id_rsa.pub
pbcopy & ~/.ssh/id_rsa.pub
Linux (requires xclip):
xclip -sel clip & ~/.ssh/id_rsa.pub
Deploy keys
Deploy keys allow read-only access to multiple projects with a single SSH key.
This is really useful for cloning repositories to your Continuous Integration (CI) server. By using deploy keys, you don’t have to setup a dummy user account.
If you are a project master or owner, you can add a deploy key in the project settings under the section ‘Deploy Keys’. Press the ‘New Deploy Key’ button and upload a public SSH key. After this, the machine that uses the corresponding private key has read-only access to the project.
You can’t add the same deploy key twice with the ‘New Deploy Key’ option. If you want to add the same key to another project, please enable it in the list that says ‘Deploy keys from projects available to you’. All the deploy keys of all the projects you have access to are available. This project access can happen through being a direct member of the projecti, or through a group. See def accessible_deploy_keys in app/models/user.rb for more information.
版权声明:本文为博主原创文章,未经博主允许不得转载。
标签:&&&&&&
&&国之画&&&& &&&&chrome插件
版权所有 京ICP备号-2
迷上了代码!4293人阅读
编程杂项(57)
以前一直在用 SVN ,最近禁不住诱惑学了学 Git 的基本操作,然后就开始在 CSDN 的CODE 平台上托管自己的代码了。开始几天用的是 msys-git。后来看到 TortoiseGit 就果断的安装上了。原以为 TortoiseGit 的配置会很简单,而且 CODE 平台的帮助文档中有介绍:
但是这个帮助文档竟然没写怎么导入 SSH key…
折腾了一番总算搞定了这个问题,这里简单的记录一下。
没有配置 SSH key 之前想要 clone 一个项目下来会报错,下图是个报错对话框的截图。
第一步要打开PuttyGen,点击 Load 按钮加载我们的key。
这里要选择那个没有扩展名的 id_rsa。这几个文件是如何生成了可以参见 CODE 平台的帮助:
之后会提示我们要保存成 putty 特定的格式。按照这上说的做就行了。
之后运行 Pageant,将刚才生成的 key 添加进取就行了 。
之后就可以正常使用 TortoiseGit 了。
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:2107553次
积分:22091
积分:22091
排名:第335名
原创:386篇
转载:17篇
译文:15篇
评论:714条
文章:22篇
阅读:36730
文章:32篇
阅读:65178
文章:11篇
阅读:106621
文章:29篇
阅读:183297
文章:31篇
阅读:153086
(5)(2)(4)(5)(1)(5)(8)(5)(4)(7)(2)(7)(7)(9)(15)(9)(22)(21)(5)(7)(4)(6)(3)(5)(4)(5)(6)(4)(2)(1)(9)(4)(4)(7)(6)(2)(3)(4)(9)(8)(2)(3)(8)(2)(6)(2)(3)(3)(4)(8)(4)(4)(14)(1)(10)(6)(2)(6)(13)(17)(11)(19)(24)如何使用git生成密匙
生成公钥和私匙(用于和服务器()进行SSH连接时的认证(使用RSA加密算法)):
$ ssh-keygen -t rsa -C “your_” 提示路径时输入一个作为保存密匙的windows路径,或者直接回车就保存在默认路径(/c/Users/yourName/.ssh/id_rsa),我不知道为什么输入了路径结果没法SSH上github,所以只好老实的直接回车用默认路径。
然后提示输入密码,这个密码是进行SSH连接时要输入的密码,是为了防止别人偷了你的密匙与服务器进行连接,我们这里就不设密码了直接回车。
命令完成后,会在/c/Users/yourName/下生成.ssh文件夹,里面的两个文件:id_rsa和id_rsa.pub
这两个就分别是私匙和公匙,可以用文本打开看看里面有啥。
接下来就是把公匙给到服务器——github了:
到github的页面上,在右上方工具栏里找到Account Settings。在打开的页面左栏有一个SSH Keys标签,选择Add SSH key,title可随便填,Key是:打开刚创建的公匙/c/Users/yourName/.ssh/id_rsa.pub用Ctrl+A全部复制,然后粘贴在这里。然后点Add key,输入你的github账户密码以添加之。
这里写图片描述
现在输入命令检查是否可以SSH连接到GitHub:
这个命令是调试版本啊,干净版本的命令是
参数不一样,回车后最后提示这样:
The authenticity of host ‘ (207.97.227.239)’ can’t be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)?
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:1626次
排名:千里之外
(window.slotbydup = window.slotbydup || []).push({
id: '4740881',
container: s,
size: '200,200',
display: 'inlay-fix'551953人阅读
Git是分布式的代码管理工具,远程的代码管理是基于SSH的,所以要使用远程的Git则需要SSH的配置。
github的SSH配置如下:
设置Git的user name和email:
$ git config --global user.name &xuhaiyan&$ git config --global user.email &haiyan.xu.&
二、生成SSH密钥过程:
1.查看是否已经有了ssh密钥:cd ~/.ssh
如果没有密钥则不会有此文件夹,有则备份删除
2.生存密钥:
$ ssh-keygen -t rsa -C “haiyan.xu.vip@”
按3个回车,密码为空。
Your identification has been saved in /home/tekkub/.ssh/id_rsa.
Your public key has been saved in /home/tekkub/.ssh/id_rsa.pub.
The key fingerprint is:
………………
最后得到了两个文件:id_rsa和id_rsa.pub
3.添加密钥到ssh:ssh-add 文件名
需要之前输入密码。
4.在github上添加ssh密钥,这要添加的是“id_rsa.pub”里面的公钥。
打开&,登陆xuhaiyan825,然后添加ssh。
5.测试:ssh
The authenticity of host ‘ (207.97.227.239)’ can’t be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘,207.97.227.239′ (RSA) to the list of known hosts.
ERROR: Hi tekkub! You’ve successfully authenticated, but GitHub does not provide shell access
Connection
三、 开始使用github
1.获取源码:
$ git clone :billyanyteen/github-services.git
2.这样你的机器上就有一个repo了。
3.git于svn所不同的是git是分布式的,没有服务器概念。所有的人的机器上都有一个repo,每次提交都是给自己机器的repo
仓库初始化:
生成快照并存入项目索引:
文件,还有git rm,git mv等等…
项目索引提交:
git commit
4.协作编程:
将本地repo于远程的origin的repo合并,
推送本地更新到远程:
git push origin master
更新远程更新到本地:
git pull origin master
添加远端repo:
$ git remote add upstream git:///pjhyett/github-services.git
重命名远端repo:
$ git:///pjhyett/github-services.git为“upstream”
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:1326299次
积分:7219
积分:7219
排名:第3169名
原创:55篇
转载:84篇
评论:101条
(1)(2)(1)(1)(1)(1)(1)(2)(1)(1)(1)(8)(1)(1)(1)(4)(8)(6)(4)(4)(2)(8)(1)(9)(3)(2)(19)(4)(1)(6)(2)(2)(2)(5)(2)(1)(3)(7)(1)(9)(1)
(window.slotbydup = window.slotbydup || []).push({
id: '4740881',
container: s,
size: '200,200',
display: 'inlay-fix'}

我要回帖

更多关于 添加ssh key 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信