免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1074 | 回复: 0
打印 上一主题 下一主题

github website 初体验 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-08-27 16:36 |只看该作者 |倒序浏览

                                by tangke  2009-08-27
本文主要讲解我在github注册的第一个项目,以及以后如何进行维护
1.首先生成一个ssh public key
$ssh-keygen
将会在~/.ssh/生成如下两个文件id_rsa  id_rsa.pub
2.在github网站上面注册一个account,然后将id_rsa.pub中的内容添加进去。
3.然后在通过我的account建议一个项目desktop_loongson.
项目地址
git://github.com/mumutou/desktop_loongson.git
4.在本地机器上面建立一个git repos
$cd desktop_loongson
$git init
$git add ./
$git commit -a -m "init repos"
建立一个远程别名
$git remote add origin git@github.com:mumutou/desktop_loongson.git
将这个repos添加到远程服务器上面并作为master分支
$git push orgin master
但是发现如下问题
The authenticity of host 'github.com (65.74.177.129)' 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 'github.com,65.74.177.129' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
看了一下网上的帮助,github确实有这个问题,可能过两天莫名其妙又好了。
现在在网上看到一篇文章可以解决github的publickey问题,本人已经验证过,OK
Linux
Step 1: Check to see if you already have a public/private key pair for your user.
If you do, it will be in your ~/.ssh directory.
[~]$ cd .ssh
[~/.ssh]$ ls
config                id_dsa.pub
id_dsa                known_hosts
Key pairs are always named like something and something.pub. The something file is your private key and must be kept secret. The something.pub file is your public key, and this is what you’ll be giving us. If you already have a key pair (in the above listing I have an id_dsa key pair) and you want to use it for GitHub, then skip to Step 3.
Step 2: Generate a public/private dsa key pair if you don’t already have one.
This is done with the ssh-keygen program:
[~/.ssh]$ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/tom/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/tom/.ssh/id_dsa.
Your public key has been saved in /home/tom/.ssh/id_dsa.pub.
The key fingerprint is:
The passphrase that you enter will be requested from you every time you push or pull from a private repository. You can use ssh-agent to automate password entry, or you can simply hit enter to not use a passphrase.
Step 3: Upload your public key to GitHub.
Copy your public key to the clipboard so you can easily paste it into your web browser. If you have xclip installed then:
[~/.ssh]$ cat id_dsa.pub | xclip
The xclip command copies whatever is sent to it via STDIN to the clipboard (you may have to use xclip -selection clipboard), ensuring that you won’t have any extraneous newlines or other problems. Now you can simply select the appropriate text entry box in GitHub and paste in your public key! If you don’t have xclip then either install it using your OS’s package manager or print out the public key to a terminal so that you can manually copy the key data.
[~/.ssh]$ cat id_dsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA1FlHRbbxXIv/hLDTeJczlEqGNt0oFcoPEEENHThzP5ku
PDsitSSUH2MATP014G/3BzaI9pdnhf02MSEcmtmIKXrm05/dzxEmp9yOY32YHyk6/rLUGGTJuWOpGt3J
6H5LWxq9yeRUuFG/pCRH3+KxOyzasSHXfXJaC5v7wPxUdAeg9k0jwsUjnqUcYvzo5+GwCXV9dIwY3Sr/
OrL2l8SCdSWyd3PLufJXKQHlouHB0NI/+G/QjWmkB8c1PJh/VuIe36mqv82V9XXKvYNaVWwz5Sg6aY9u
p2lgDEme+AFdPPjOnkdF6OHCr7ymKg6c/B2YCbOW7QN/L4uAdVOhTNnJMQ== tom@volcano
Copy the entirety of the public key to the clipboard. It is important that there are no newlines in the key (copying from the cat output in your console should work properly. Now you can simply select the appropriate text entry box in your GitHub account and paste in your public key!
参考文章:
http://github.com/guides/providing-your-ssh-key
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/100996/showart_2038721.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP