eclipse git上传项目目权限被拒绝怎么办

Github权限认证(创建一个项目版本库后遇到的权限问题) - 东升红日辉万里,明泽润物彻古今 - ITeye技术网站
博客分类:
最新简约版
git config --global user.name "你在github上的用户名"
git config --global user.email 注册的邮件地址
mkdir ~/.ssh
ssh-keygen -t rsa -C "注册的邮件地址"
cat id_rsa.pub
然后把内容贴到github网站ssh keys中
首先在github上注册一个账号,创建一个“自定义名称”的版本库
创建完成之后,github会提供一个简易的操作指南
Global setup:
Set up git
git config --global user.name "user_name"
git config --global user.email ×××@×××.com
Add your public key
Next steps:
mkdir project_name
cd project_name
touch README
git add README
git commit -m 'first commit'
git remote add origin :user_name/project_name.git
git push -u origin master
Existing Git Repo?
cd existing_git_repo
git remote add origin :user_name/project_name.git
git push -u origin master
Importing a Subversion Repo?
Click here
When you're done:
按照这个步骤来,我乎略来第一步的
Add your public key,以为他仅仅是一个帮助链接
但是在我提交代码的时候,出现了错误提示
“Permission denied (publickey).
fatal: The remote end hung up unexpectedly
这个错误的意思无非就是权限验证失误
造成没有权限的主要原因就是我漏掉的一步
于是我去补充,点击那个帮助链接就可以看到内容
/linux-set-up-git/
按照步骤首先是
第一步 检查 SSH keys
$ cd ~/.ssh
检查是否有".ssh"这个目录,如果没有则直接跳转到第三步,其他情况进入第二步
第二步 备份 并 删除已经存在的ssh key
如果你的目录文件中已经存在了ssh文件,那么你最好是备份并删除这些旧文件
操作步骤如下:
$ ls
# 显示来当前目录下的所有子目录
# config id_rsa id_rsa.pub known_hosts
$ mkdir key_backup
# 在当前目录下创建一个叫做"key_backup"的子目录
$ cp id_rsa* key_backup
# 备份以前的key文件到上面新建的文件夹中
$ rm id_rsa*
# 删除旧的key文件
第三部 生成一个新的ssh key
按照下面的代码操作,即可生成一个新的ssh key。当你被要求输入保存key的文件目录时,可以直接按enter键使用默认设置
$ ssh-keygen -t rsa -C "your_"
# 使用一个私人的email地址,来生成一个ssh key
# 生成 公开/私有 的一对key(Generating public/private rsa key pair.)
# 输入要保存key文件的目录(enter键 使用括弧里面的默认设置)
(/Users/your_user_directory/.ssh/id_rsa):&press enter&
# 然后输入一个密码(passphrases)这个密码可以不用输入,直接回车就可以了,要不然每次提交代码都要输入密码
Enter passphrase (empty for no passphrase):&enter a passphrase&
Enter same passphrase again:&enter passphrase again&
然后它会给你返回这些东西:
Your identification has been saved in /Users/your_user_directory/.ssh/id_rsa.
Your public key has been saved in /Users/your_user_directory/.ssh/id_rsa.pub.
The key fingerprint is:
01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db user_
The key's randomart image is:
+--[ RSA 2032]----+
+-----------------+
最后 就是把你的SSH添加到你的GitHub账号中
访问网站并按照下列顺序访问 “Account Settings” & Click “SSH Public Keys” & Click “Add another public key”
打开上面生成的id_rsa.pub文件& (Notepad, TextEdit, or gedit will do just fine). 这个是你的公开的 SSH key. 你可能需要打开“查看隐藏目录文件”选项,才能找到他,因为这个 .ssh 是隐藏文件目录. 接下来就是非常重要的是,复制文件中的key内容(不要添加任意空格或者空行),复制到网站中弹出的文本框中,点击确定就大功告成了。
接下来测试一下
$ ssh -T Attempts to ssh to github
Which should give you this:
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)?
Don’t worry, this is supposed to happen. Type “yes”.
Hi username! You've successfully authenticated, but GitHub does not provide shell access.
Having problems?
hotsunshine
浏览: 366353 次
来自: 北京
$(&某一个dom&).change()
非常感谢,我的也是磁盘满了导致的问题,顺便分享下查看磁盘的命令 ...
vikki 写道沙发先。楼主,这些代码例子你都运行过吗?运行过 ...
沙发先。楼主,这些代码例子你都运行过吗?关于ssh证书访问git仓库时的权限问题
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ & & & & WARNING: UNPROTECTED PRIVATE KEY FILE! & & & & &@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0740 for '/home/lulei1/.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: /home/lulei1/.ssh/id_rsa
Permission denied (publickey).
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ & & & & WARNING: UNPROTECTED PRIVATE KEY FILE! & & & & &@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0740 for '/home/lulei1/.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: /home/lulei1/.ssh/id_rsa
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
正确的设置
chmod 600 id_rsa
(window.slotbydup=window.slotbydup || []).push({
id: '2467140',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467141',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467142',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467143',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467148',
container: s,
size: '1000,90',
display: 'inlay-fix'

我要回帖

更多关于 git上传项目 的文章

 

随机推荐