I haven't used git for a long time.
$git submodule Update--init--recursive
===============================
As a result, the following prompt appears
Cloning into ' submodules/******** ' ...
Permission denied (PublicKey).
===============================
I haven't touched git for a long time, and I don't have any impressions. No way, only Google, fortunately, a search to get a piece of classic official help:
https://help.github.com/articles/generating-ssh-keys/
=================================
Generating SSH Keys
SSH Keys is a-identify trusted computers, without involving passwords. The steps below would walk you through generating a SSH key and adding the public key to your GitHub account.
We recommend this regularly review your SSH keys list and revoke any, haven ' t been used in a while.
Tip: GitHub has a Mac client! You can use it without ever touching, the command line.
Step 1:check for SSH keys
First, we need to check for existing SSH keys on your computer. Open Terminal and enter:
Ls-al ~/.ssh# Lists the files in your. SSH directory, if they exist
Check the directory listing to see if you already has a public SSH key. By default, the filenames of the public keys is one of the following:
- Id_dsa.pub
- Id_ecdsa.pub
- Id_ed25519.pub
- Id_rsa.pub
Tip: If you receive a error that the ~/.ssh doesn ' t exist, and don ' t worry! We ' ll create it in Step 2.
Step 2:generate a new SSH key
-
with Terminal still open, copy and paste the text below. Make sure your substitute in your GitHub email address.
Ssh-keygen-t rsa-c "[email protected]"# Creates a new SSH key, using the provided email as a label# Generating public/private RSA key pair.
-
We strongly suggest keeping the default settings as they is, so if you're ' re prompted to ' Enter a file on which to save th E key ", just press Enter to continue.
# Enter file in which to save the key (/users/you[press Enter]
-
You'll be asked to enter a passphrase.
[Type a passphrase] [Type passphrase again]
Tip: We strongly recommend a very good, secure passphrase. For more information, see "Working with SSH key passphrases".
-
After you enter a passphrase, you'll be given the fingerprint, or ID, of your SSH key. It'll look something like this:
# Your identification have been saved in/users/you/.ssh/id_rsa. # Your Public key have been saved in/users/you/.ssh/id_rsa.pub. # The key fingerprint is:01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db [email protected]
Step 3:add your key to the Ssh-agent
To configure the Ssh-agent program to use the SSH key you ' ve generated:
-
Ensure Ssh-agent is enabled:
# Start the ssh-agent in the backgroundeval "$ (ssh-agent-s)"# agent PID 59566
-
ADD your generated SSH key to the ssh-agent:
Ssh-add ~/.ssh/id_rsa
Step 4:add your SSH key to your account
To configure your GitHub account to use your SSH key:
Copy the SSH key to your clipboard. Keep in mind this your key may also is named id_dsa.pub , id_ecdsa.pub or id_ed25519.pub , in which case you must change the filename as follows:
Pbcopy < ~/.ssh/id_rsa.pub# Copies The contents of the Id_rsa.pub file to your clipboard
Warning: It ' s important to copy the key exactly without adding newlines or whitespace.
Add the copied key to GitHub:
-
In the top right corner of any page, click .
-
In the user settings sidebar, click SSH keys.
-
Click Add SSH key.
- The Title field, add a descriptive label for the new key. For example, if you ' re using a-personal Mac, you might call this key "personal MacBook Air".
- Paste your key into the "key" field.
- Click Add key.
- Confirm the action by entering your GitHub password.
Step 5:test the connection
To make sure everything are working, you'll now try to SSH into. When you do this, you'll be asked to authenticate this action using your password, which are the SSH key passphrase you c Reated earlier.
-
Open Terminal and enter:
ssh-t [email protected]# attempts to ssh to GitHub
-
Warning:
# the authenticity of host ' Github.com (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. # is sure you want to continue connecting (yes/no)?
Verify the fingerprint in the message to see matches the following message and then type Yes :
# Hi username ! You ' ve successfully authenticated, but GitHub does Not# provide shell access.
-
If the username in the message was yours, you ' ve successfully set up your SSH key!
If you receive a message on "Access Denied," you can read these instructions for diagnosing the issue.
If you ' re switching from HTTPS to SSH, you'll now have need to update your remote repository URLs. For more information, see Changing a remote ' s URL.
================================
Speak very detailed, thanks again, step by step installation documentation said, unexpectedly discovered before on their own GitHub has done similar operations. Is it really old, forget all ...
Permission denied (PublicKey) appears in the "ASK" git usage.