havendblog

【小菜鸟】如何使用Github(简单使用)

为了在ubutu中安装opencv,于是要在github上下载源代码,可是不会用github,这就尴尬了。

参考网站:

http://blog.csdn.net/p10010/article/details/51336332  注册github

https://www.zhihu.com/question/20070065  github界面介绍

http://www.jianshu.com/p/q81RER  介绍markdown

 

不知道为什么老是装不了,发现原来是空间已满,其实最近开机都会有提醒,就是一直没有理会。

解决由于更新使用的旧内核引起的boot空间满的问题。

http://blog.csdn.net/WxyangID/article/details/53097208  

http://www.jb51.net/article/106976.htm

可是为什么每次要删除某个旧内核时,总是会出现下列软件包有未满足的依赖关系呢?

http://blog.chinaunix.net/uid-26552184-id-3499251.html

 

1.df -h (查看Ubuntu的文件系统 使用情况)

2. uname -a (查看当前使用的内核版本)

3.sudo apt-get remove linux-image- (按两次tab键)

或者查看已安装的内核dpkg --get-selections |grep linux-image

4.sudo apt-get remove linux-image-4.4.0-31-generic(再重复两次删除36,38)(删除多余内核)

结果是即boot满,又无法删除有依赖的软件包。

最终找到了一个方案可以搞定的了:

http://blog.csdn.net/xhw035/article/details/52422970

而且要第二种方法才OK,

sudo dpkg -P linux-image-4.4.0-31-generic linux-image-extra-4.4.0-31-generic

然后就可以开始github的安装与配置了:

http://blog.csdn.net/shursulei/article/details/73017668?utm_source=itdadao&utm_medium=referral

  1. 在网站注册帐号,创建工程 test 进入工程,右下角会有一个项目仓库的地址。

  2.Linux下 安装github

  sudo apt -get install git git-core git-doc

  3. 创建rsa公钥

  ssh-keygen -t rsa -C “your_email@youremail.com”

  整个过程中有一个需要填密码

  然后后进入~/.ssh目录 找到公钥id_rsa.pub

  记事本打开复制文字

  进入github.com中的的设置,找到pubkey选项,填入公钥。

  命题随便填

  4. 设置账户信息

  git config --global user.name “lukeyan”   这里我用的是“lucida”

  git config --global user.email xxx@gmail.com

  5. 测试ssh key是否成功

  测试ssh key是否成功,使用命令“ssh -T git@github.com”,如果出现You’ve successfully authenticated, but GitHub   does not provide shell access 。这就表示已成功连上github。  然而我测试后是Could not resolve hostname github.con: Name or service not known.

关于ssh链接主机失败的问题:

cn.archive.ubuntu.com/

运用shh -T -v git@github.com查看具体出错信息,再根据信息来调试

然后再查看下 ~/.ssh文件夹下的文件:ls ~/.ssh ,居然只有known_hosts文件了。所以一直找不到  id_rsa  ,  id_dsa  ,  id_ecdsa 这三个文件。

那么问题来了,这三个文件按道理来说是有的,为什么没有产生呢?奇了怪了。

网上有人用起名字的时候用  id_rsa ,试了下,还是不行。blog.csdn.net/samxx8/article/details/51497004

发现有可能是没有在 “~/.ssh/” 目录下操作用命令pwd查看当前路径。

查看结果的确不在所需的目录中,用命令cd /.... 来切换目录。

然后再重新试了下,还是有问题,但感觉比之前的好很多了。问题依旧是链接主机失败。

http://www.lxway.com/526190921.htm

现在我们让~/.ssh文件夹下,还原当初没有改时的名字id_rsa
cp github id_rsa && cp gitbub.pub id_rsa.pub      (注意了,这是网上其他人的代码,github是创建人取的名字,打代码时需要该)

也就是把刚刚创建的密钥文件复制的一直在找的那三个文件里去。

可是还是有问题:OpenSSH_7.2p2 Ubuntu-4ubuntu2.2, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to github.com [192.30.255.112] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/havenubuntu/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/havenubuntu/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/havenubuntu/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/havenubuntu/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/havenubuntu/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/havenubuntu/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/havenubuntu/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/havenubuntu/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.2
debug1: Remote protocol version 2.0, remote software version libssh_0.7.0
debug1: no match: libssh_0.7.0
debug1: Authenticating to github.com:22 as \'git\'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
debug1: Host \'github.com\' is known and matches the RSA host key.
debug1: Found key in /home/havenubuntu/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/havenubuntu/.ssh/lucida
debug1: Authentications that can continue: publickey
debug1: Offering RSA public key: 497060748@qq.com
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/havenubuntu/.ssh/id_rsa
Enter passphrase for key \'/home/havenubuntu/.ssh/id_rsa\':
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/havenubuntu/.ssh/id_dsa
debug1: Trying private key: /home/havenubuntu/.ssh/id_ecdsa
debug1: Trying private key: /home/havenubuntu/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).

这次真的太牛逼了,简直了。

检查系统中已有的密钥;    

http://www.linfuyan.com/generating-ssh-keys/

命令行: ls -al ~/.ssh 

为了更好的重新来过,我们把旧的密钥删除,

 

删除文件夹实例:
rm -rf /var/log/httpd/access
将会删除/var/log/httpd/access目录以及其下所有文件、文件夹

然后按照这个全部重新开始:

http://www.linfuyan.com/generating-ssh-keys/

最正确的一个安装网址:http://www.linuxidc.com/Linux/2016-09/135527.htm

解决了sign_and_send_pubkey: signing failed: agent refused operation的问题:

http://blog.csdn.net/sz457763638/article/details/53783174

然后执行了以下命令才好。。

eval "$(ssh-agent -s)"
ssh-add
 

 

 

 

 

  

 


分类:

技术点:

相关文章: