Git使用之Permission Denied问题解决
2014-10-08 10:51
417 查看
今天碰到了Git的Permission Denied问题。
在安装好git之后,我们一般会配置用户名和邮箱
git config --global user.name "zengjinlong" #--global表明本机的所有git仓库均使用该配置
git config --global user.email "zengjinlong@xunlei.com"
但是当我们克隆一个库的时候,发现不论你怎么输入密码都是说Permission Denied。
其实,这是你没有生成公钥
找到这个页面:
SSH Keys
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 your 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.
ssh-keygen -t rsa -C "$your_email"
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.
很简单,就是用你的邮箱生成一个公钥,然后加入到你的代码管理网站中。然后在如下页面中加入SSH Key到项目中。
Add SSH Key
SSH keys allow you to establish a secure connection between your computer and GitLab
Before you can add an SSH key you need to generate it
然后再git clone 一次,发现可以了。好了。这个问题解决。
在安装好git之后,我们一般会配置用户名和邮箱
git config --global user.name "zengjinlong" #--global表明本机的所有git仓库均使用该配置
git config --global user.email "zengjinlong@xunlei.com"
但是当我们克隆一个库的时候,发现不论你怎么输入密码都是说Permission Denied。
其实,这是你没有生成公钥
找到这个页面:
SSH Keys
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 your 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.
ssh-keygen -t rsa -C "$your_email"
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.
很简单,就是用你的邮箱生成一个公钥,然后加入到你的代码管理网站中。然后在如下页面中加入SSH Key到项目中。
My SSH keys
Add SSH KeySSH keys allow you to establish a secure connection between your computer and GitLab
Before you can add an SSH key you need to generate it
然后再git clone 一次,发现可以了。好了。这个问题解决。
相关文章推荐
- git使用中遇到的remote:Permission to xxx denied to xxx问题如何解决报错403找不到的问题
- git使用中遇到的remote:Permission to xxx denied to xxx问题如何解决
- 解决mac电脑上出现Permission to xxx.git denied to xxx的问题
- 解决git clone提示Permission denied publickey 问题
- 解决vcenter时出现的“Permission to perform this operation was denied”问题
- Linux上SVN的 "db/txn-current-lock: Permission denied" 问题解决办法
- git-svn使用以及问题解决
- permission denied make_sock could not bind to address 81问题解决
- adb push Permission Denied(看博文解决问题需!谨!慎!啊!)
- cygwin 环境下使用taglist cannot open temporary file : Permission denied^@问题及解决方案
- Linux上SVN的 "db/txn-current-lock: Permission denied" 问题解决办法
- Android Studio 1.01 使用 Git 总结及问题解决(需要在本地安装git )
- windows下使用git管理代码,其中出现的问题的解决办法
- 解决init: sys_prop: permission denied uid:1003 name:service.bootanim.exit问题
- git-svn使用方式及使用中的问题(已解决)
- 使用Zend Mail Permission denied 错误的解决办法
- git使用问题解决----warning: LF will be replaced by CRLF
- Git 使用问题解决(未完待续)
- ssh permission denied问题解决
- 【Git使用详解】Egit使用过程中遇到的问题及解决办法