1. 程式人生 > >Please make sure you have the correct access rights

Please make sure you have the correct access rights

A "Permission denied" error means that the server rejected your connection. There could be several reasons why, and the most common examples are explained below.

Should the sudo command be used with Git?

You should not be using the sudo command with Git. If you have a very good reason you must usesudo

, then ensure you are using it with every command (it's probably just better to use su to get a shell as root at that point). If you generate SSH keys without sudo and then try to use a command likesudo git push, you won't be using the same keys that you generated.

Check that you are connecting to the correct server

Typing is hard, we all know it. Pay attention to what you type; you won't be able to connect to "githib.com" or "guthub.com". In some cases, a corporate network may cause issues resolving the DNS record as well.

To make sure you are connecting to the right domain, you can enter the following command:

ssh -vT [email protected]# OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011# debug1: Reading configuration data /Users/you/.ssh/config# debug1: Reading configuration data /etc/ssh_config# debug1: Applying options for *# debug1: Connecting to github.com [192.30.252.131] port 22.

Note the IP address (the numbers within the [ ] brackets). The connection should be made to a GitHub IP address, on port 22, unless you're overriding settings to use SSH over HTTPS.

Always use the "git" user

All connections must be made as the "git" user. If you try to connect with your GitHub username, it will fail:

ssh -T [email protected]# Permission denied (publickey).

Instead, you should verify your connection by typing:

ssh -T [email protected]# Hi username! You've successfully authenticated...

Make sure you have a key that is being used

  1. Open the terminal.

  2. Verify that you have a private key generated and loaded into SSH:

    # start the ssh-agent in the backgroundeval "$(ssh-agent -s)"# Agent pid 59566ssh-add -l# 2048 a0:dd:42:3c:5a:9d:e4:2a:21:52:4e:78:07:6e:c8:4d /Users/you/.ssh/id_rsa (RSA)

The ssh-add command should print out a long string of numbers and letters. If it does not print anything, you will need to generate a new SSH key and associate it with GitHub.

Tip: On most systems the default private keys (~/.ssh/id_rsa~/.ssh/id_dsa and ~/.ssh/identity) are automatically added to the SSH authentication agent. You shouldn't need to run ssh-add path/to/key unless you override the file name when you generate a key.

Getting more details

You can also check that the key is being used by trying to connect to [email protected]:

ssh -vT [email protected]# ...# debug1: identity file /Users/you/.ssh/id_rsa type -1# debug1: identity file /Users/you/.ssh/id_rsa-cert type -1# debug1: identity file /Users/you/.ssh/id_dsa type -1# debug1: identity file /Users/you/.ssh/id_dsa-cert type -1# ...# debug1: Authentications that can continue: publickey# debug1: Next authentication method: publickey# debug1: Trying private key: /Users/you/.ssh/id_rsa# debug1: Trying private key: /Users/you/.ssh/id_dsa# debug1: No more authentication methods to try.# Permission denied (publickey).

In that example, we did not have any keys for SSH to use. The "-1" at the end of the "identity file" lines means SSH couldn't find a file to use. Later on, the "Trying private key" lines also indicate that no file was found. If a file existed, those lines would be "1" and "Offering public key", respectively:

ssh -vT [email protected]# ...# debug1: identity file /Users/you/.ssh/id_rsa type 1# ...# debug1: Authentications that can continue: publickey# debug1: Next authentication method: publickey# debug1: Offering RSA public key: /Users/you/.ssh/id_rsa

Verify the public key is attached to your account

You must provide your public key to GitHub to establish a secure connection.

  1. Open Terminal.
  2. Start SSH agent in the background.

    eval "$(ssh-agent -s)"# Agent pid 59566
  3. Enter ssh-add -l and take note of the resulting fingerprint:

    ssh-add -l# 2048 a0:dd:42:3c:5a:9d:e4:2a:21:52:4e:78:07:6e:c8:4d /Users/USERNAME/.ssh/id_rsa (RSA)
  4. Settings icon in the user barIn the top right corner of any page, click your profile photo, then clickSettings.

  5. SSH keysIn the user settings sidebar, click SSH keys.

  6. SSH key listing in GitHubCompare the list of SSH keys with the output from ssh-add -l.

If you don't see your public key in GitHub, you'll need to add your SSH key to GitHub to associate it with your computer.

If you see an SSH key you're not familiar with on GitHub, delete it immediately and contact GitHub support, for further help. An unidentified public key may indicate a possible security concern. For more information, see "Keeping your SSH keys safe."

相關推薦

[Git]Please make sure you have the correct access rights and the repository exists

perm not 配置 兩個 需要 acc repos http 機器 這個問題是這樣,需要在已有github賬號的A機器上,再創建一個github賬號,新賬號創建完畢,將代碼通過機器A push上之後,再另一臺機器B,clone 這個項目時報出了如下錯誤: Permiss

Git clone時出現Please make sure you have the correct access rights and the repository exists.問題已解決。

already 下載 cor 兩個 .com pair 賬戶 same 使用 看了好多資料終於搞定了git 中clone命令報錯這個問題,廢話不多說直接上步驟希望對大家有幫助。 1 刪除.ssh文件夾(直接搜索該文件夾)下的known_hosts(手動刪除即可

Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights

please sudo _id ima upd cal .com root pin 第一次提交遇到這樣的情況,怎麽回事呢,我在github上提交了ssh key 的啊。 排查先看看能不能解析, 1.先 ping https://github.com 把ip添加到 ho

git "Could not read from remote repository.Please make sure you have the correct access rights."解決方案

tpc 覆蓋 com 設置 _id pub ould ack ref 我們在使用git clone 或其他命令的時候,有時候會遇到這類問題,如圖: fatal: Could not read from remote repository. Please make s

git下載代碼遇到的‘Please make sure you have the correct access rights and the repository exists’問題

log strong nbsp urn 成功 參考 刪除 ron mail 接著昨天的搭建博客,今天想直接把vuepress克隆到我的電腦上,結果出現了問題 忘記截圖了,反正就記得這麽一句話:‘Please make sure you have the correct

(轉)git遇到的問題之“Please make sure you have the correct access rights and the repository exists.”

key pair 遇到 重新 出了 csdn ssh-key vat work 直接 對於git的提交一直很小心翼翼,感覺一不小心就會踩到莫名的坑。 這不, 某天commit 就遇到了On branch master nothing to commit (wor

git 訪問自建gitlab報錯:Please make sure you have the correct access rights and the repository exists.

1.首先設定git身份的名字和郵箱:     git config --global user.name "yourname"     git config --global user.email“[email protected]"

git下載程式碼遇到的‘Please make sure you have the correct access rights and the repository exists’問題

接著昨天的搭建部落格,今天想直接把vuepress克隆到我的電腦上,結果出現了問題 忘記截圖了,反正就記得這麼一句話:‘Please make sure you have the correct access rights and the repository exists’ 在網上搜索了一

git遇到的問題:Please make sure you have the correct access rights and the repository exists.解決方案

輸入:git push -u origin master命令出現以下類似內容 Theauthenticity of host 'github.com (13.250.167.23)' can't be established. RSAkey fingerprint is SHA256:nTh

git "Could not read from remote repository.Please make sure you have the correct access rights."解決方案

我們在使用git clone 或其他命令的時候,有時候會遇到這類問題,如圖: fatal: Could not read from remote repository. Please make sure you have the correct access rig

git pull出錯fatal:Please make sure you have the correct access rights.and the repository exists.

初學liunx,真是坑爹很多了,每天的錯誤。。。 Warning: Permanently added the RSA host key for IP address ‘192.168.25.*’ to the list of known hosts. Pe

Could not read from remote repository.Please make sure you have the correct access rights.解決方法

我們在使用git clone 或其他命令的時候,有時候會遇到這類問題,如圖:fatal: Could not read from remote repository.Please make sure you have the correct access rightsand

Git"Could not read from remote repository.Please make sure you have the correct access rights."解決方案

我們在使用Git clone 或其他命令的時候,有時候會遇到這類問題,如圖: fatal: Could not read from remote repository. Please make sure you have the correct access ri

Please make sure you have the correct access rights

A "Permission denied" error means that the server rejected your connection. There could be several reasons why, and the most common examples are explai

git遇到的問題之“Please make sure you have the correct access rights and the repository exists.

Please make sure you have the correct access rights and the repository exists. 然後谷歌了一下,原來是ssh key有問題,連線不上伺服器~~ 參閱了很多的答案,發現寫的都不是很完

git clone報錯 "Could not read from remote repository..Please make sure you have the correct access

1.下載git,使用命令: yum install git 2.配置git: 1 git config --global user.name "Your Name" 2 git config --global user.email "[email protected]"

Node.js報錯 configure error: No acceptable C compiler found! Please make sure you have

報錯:Node.js configure error: No acceptable C compiler found!Please make sure you have a C compiler installed on your system and/orco

PL/SQL連線報錯問題 make sure you have the 32 bits oracle client installed

Windows 64位下裝Oracle 11g 64位,PLSQL Developer使用出現以下問題: 1、Database下拉框為空:   2、強制輸入使用者名稱、密碼及Database,登入彈出: Initialzation error Could not i

解決X64作業系統PL/SQL連線報錯問題 make sure you have the 32 bits oracle client installed

Windows 64位下裝Oracle 11g 64位,PLSQL Developer使用出現以下問題: 1、Database下拉框為空:   2、強制輸入使用者名稱、密碼及Database,登入彈出: Initialzation error Could not

解決VM提示:VMware Workstation cannot connect to the virtual machine. Make sure you have rights to run the program, access all directories the program uses

問題: 在開啟虛擬機器的時候報: VMware Workstation cannot connect to the virtual machine. Make sure you have rights to run the program, access all directories the progr