git config ssh key

Source: Internet
Author: User

git config ssh key

If the host (the currently logged on user) does not have a GIT account prior to adding the first git account and configuring the SSH key,

Follow the steps below:

1 CD ~/.ssh

2 ssh-keygen-t rsa-c ' [email protected] '

3 Cat Id_rsa.pub

4 Copy the public key to the GIT server

5 test: Git clone [email protected]: Liulian/mahout-0.9-custom.git

Additional Information:

1

Ssh-keygen-t rsa-c ' [email protected] '

Generating public/private RSA key pair.

Enter file in which to save the key (/DATA/HOME/LIULIAN/.SSH/ID_RSA):

Enter passphrase (empty for No passphrase): (Enter password)

Enter same passphrase again: (Enter password again)

Your identification has been saved In/data/home/liulian/.ssh/id_rsa.

Your public key has been saved in/data/home/liulian/.ssh/id_rsa.pub.

The key fingerprint is:

72:d2:d7:6e:35:68:e2:d8:78:5d:a6:99:4e:df:9e:0e [email protected]

The key ' s Randomart image is:

+--[RSA 2048]----+

| |

| |

| |

|   . .   . |

| o S o+ = |

| + * =b. |

| o +oe |

| . +....|

| . o+o|

+-----------------+

2

Cat Id_rsa.pub

ssh-rsaaaaab3nzac1yc2eaaaabiwaaaqeavo04k2+6pezjdj//5r6evj19dbjqoawwb/btcdkenwdb8cpq6zrqqi3b+ pebzn3abeji9nlvheicsrv+27v5nlrll2euszq1i/qws9e4wnlkvg9mzo+omxuck7izvt3ddwokg6tqeajjd5xx+ uq88ln6vap4n77mbnu40febj1gdmdb65cjwlgjfdtyuu5aw8me8rzcuj+ahvzf4u+ Smvcejncw0frtwrmfnosvx4j9qeymwli2qebtw10hefzsv9u0f5tmte2cchfrbdxkwvyav9esulaofdw1xmrntob+[email protected]

3

git clone [email protected]:liulian/mahout-0.9-custom.git

Initialized Empty Git repository in/data/home/liulian/project/mahout/mahout-0.9-custom/mahout-0.9-custom/.git/

The authenticity of host ' git.host.com (10.150.144.21) ' can ' t be established.

RSA key fingerprint is58:c1:82:35:44:e8:6f:9d:3b:3e:db:c0:c4:9d:4e:cf.

Is you sure want to continue connecting (yes/no)? Yes

warning:permanently added ' git.host.com,10.150.144.21 ' (RSA) to the list of known hosts.

Enter passphrase for key '/data/home/liulian/.ssh/id_rsa ':

Remote:counting objects:3123, done.

Remote:compressing objects:100% (2233/2233), done.

Remote:total 3123 (Delta 739), reused 3120 (delta739)

Receiving objects:100% (3123/3123), 5.77 Mib,done.

Resolving deltas:100% (739/739), done.

If a git account has been configured before the host (the currently logged on user) and then the new Git account is configured, follow these steps.

1 CD ~/.ssh

2 Generate key

Ssh-keygen-t rsa-c ' [email protected] '

Generating public/private RSA key pair.

Enter file in which to save the key (/ROOT/.SSH/ID_RSA): Linger_git

Enter passphrase (empty for no passphrase): 09388296

3 Viewing the public key and copying it to a git server

Cat Linger_git.pub

Ssh-rsaaaaab3nzac1yc2eaaaabiwaaaqeau7dqlbnyftf2cc0jehx9ljcjeairmxzxrxlkws89zwzscldy8d84otyo2zwikymxwbjmfh1yiqhkw6hfpmf +9ayjitrbnb6cztf38fuoknl6wburphkkb9wopa1hl4pcjt32prr2u9riclg9ev2gshvssuiougscypg6dyl2ugedllegfxs0z1fpqd8gonpmtetrutxponvc mmjpvlaw6gr/0h6/ff/qaauvpabw3oa3c9lwvkdhn6apdmuqtfsjpn1i0hoecsdvfxuouj+9jastvwj1wh7yhggvb9lohoyrxso/ yzkqlvfx8rhlyj/vnhnoxuncfw/m9r1jx4myxw==[email protected]

4

VI Config

Host git.host.com # #可以随意命名, use this name when linking

HostName git.host.com

User git

# Port 22

Identityfile ~/.ssh/linger_git

5 Testing

git clone [email protected]:liulian/weibo.git

Initialized Empty Git repository in/root/liulian/git/weibo/weibo/.git/

Enter passphrase for key '/root/.ssh/linger_git ':

Remote:counting objects:106, done.

Remote:compressing objects:100% (80/80), done.

Remote:total 106 (Delta), reused 103 (Delta 23)

Receiving objects:100% (106/106), 190.24 Kib,done.

Resolving deltas:100% (23/23), done.

PS: If the host is currently logged on user, not set any git account, remember to use the above Method 1, I have tried in this case directly with the above Method 2, unexpectedly, and then use Method 1 on the line.

http://blog.163.com/zhou_411424/blog/static/1973621562013611640347/

http://chiyx.iteye.com/blog/1872447

This article linger

This article link: http://blog.csdn.net/lingerlanlan/article/details/46640219



git config ssh key

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.