Build and deploy SSH key

After installing the win7 Git, Git Bash enter commands using the following steps:

1、git config --global user.name "usernme"

2、git config --global user.email emailName

3, git bash into the project directory: git init

4, use git add filename Add File to Library

5, using git commit -m "first commit" to commit

6, using ssh-keygen -C '[email protected]' -t rsa

7, in the pub file copy key, add in when SSH keys GitHub

8, ssh -T [email protected] verify error: Permission denied (publickey).

This is how to solve? Find a lot of information, have not been resolved! ([email protected] is my GitHub registered mail, username is my GitHub user name)

 

official:

1. How to generate a public key ssh

You can generate sshkey the following command:

ssh-keygen -t rsa -C "[email protected]"  

# Generating public/private rsa key pair...
# 三次回车即可生成 ssh key

View your public key, and add him to the yard cloud (Gitee.com) SSH key add the address: https: //gitee.com/profile/sshkeys)

cat ~/.ssh/id_rsa.pub
# ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6eNtGpNGwstc....

After the addition, the input terminal (Terminal) in

ssh -T git@gitee.com

If the return

Welcome to Gitee.com, yourname!

Then add prove successful.


2. how to add users ssh key?

  1. Personal settings page --- "SSH public key to add, specific links
  2. Screenshot below Enter Caption

ssh key projects and users 3. ssh key two places What is the difference?

Sshkey project only for the project, and we offer the only project to deploy a public key, that is 项目下的公钥仅能拉取项目, which is usually used for the production server to pull the warehouse code. The user's key is for the user, the user has permission to add a key to the user name and the project users to participate in the project, in general, the key user has permission to push and pull, and the key projects of the only a pull permissions.

 

After installing the win7 Git, Git Bash enter commands using the following steps:

1、git config --global user.name "usernme"

2、git config --global user.email emailName

3, git bash into the project directory: git init

4, use git add filename Add File to Library

5, using git commit -m "first commit" to commit

6, using ssh-keygen -C '[email protected]' -t rsa

7, in the pub file copy key, add in when SSH keys GitHub

8, ssh -T [email protected] verify error: Permission denied (publickey).

This is how to solve? Find a lot of information, have not been resolved! ([email protected] is my GitHub registered mail, username is my GitHub user name)

Guess you like

Origin www.cnblogs.com/matd/p/10969312.html