• win7下使用git bash 访问github(总是报permissions 0644 too open)


    配置过程请参加博客

    http://www.xbc.me/install-git-on-windows/

    和github help https://help.github.com/articles/set-up-git

    最后一步提交代码到github仓库:

    git push origin master

    问题来了:

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    > @    WARNING: UNPROTECTED PRIVATE KEY FILE!          @
    > @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    > Permissions 0644 for
    > '/h/Users/Tim/.ssh/id_rsa' are too
    > open. It is recommended that your
    > private key files are NOT accessible
    > by others. This private key will be
    > ignored. bad permissions: ignore key:
    > /h/Users/Tim/.ssh/id_rsa Permission
    > denied (publickey).

    查看文件权限:

    Tim@HZ ~
    $ ls -al /h/Users/Tim/.ssh/
    total 16
    drwxr-xr-x 7 Tim Administ 4096 Oct 28 16:11 .
    drwxr-xr-x 1 Tim Administ 20480 Oct 28 16:39 ..
    -rw-r--r-- 1 Tim Administ 1675 Dec 28 2012 github_rsa
    -rw-r--r-- 1 Tim Administ 394 Dec 28 2012 github_rsa.pub
    -rw-r--r-- 1 Tim Administ 1671 Oct 28 18:59 id_rsa
    -rw-r--r-- 1 Tim Administ 403 Oct 28 18:59 id_rsa.pub
    -rw-r--r-- 1 Tim Administ 1199 Oct 28 16:36 known_hosts

    尝试着用chmod命令修改id_rsa的权限为0600,发现死活没法修改,在网上搜了半天,发现很多人也遇到了这种问题,但是都没有解决。

    在绝望之际,搜到了博客

    http://blog.csdn.net/johnnywww/article/details/8667168

    试着按照里面的方法配置ssh-key生成了git.key和git.key.pub,终于成功了!!!!

    1. ssh-keygen -t rsa -C "xxx@163.com" -f git.key  
    将生成的key git.key  git.key.pub 拷贝到~/.ssh中去。
    将git.key.pub拷贝到github上去
    编辑~/.ssh中的config文件(没有的话,新建一个),输入如下内容(git.key是私有的key文件)
    1. Host github.com  
    2. User xxx  
    3. Hostname github.com  
    4. PreferredAuthentications publickey  
    5. IdentityFile ~/.ssh/git.key
    ssh -Tv git@github.com
     
    感谢http://blog.csdn.net/johnnywww/article/details/8667168的博主,让我5个小时的努力没有白费啊!!
  • 相关阅读:
    套件测试
    注解实战aftersuite和beforesuite
    注解实战Beforeclass和Afterclass
    Centos7下安装Mongodb
    java的算法实现冒泡
    注解实战BeforeMethed和afterMethed
    前端 HTML的规范
    前端 HTML标签介绍
    前端 HTML文档 详解
    前端 HTML 简介
  • 原文地址:https://www.cnblogs.com/rubytim/p/3393035.html
Copyright © 2020-2023  润新知