Ssh-keygen and Deploy Key_git

Source: Internet
Author: User

Demand:

Reference: http://blog.csdn.net/wh_19910525/article/details/7433164

In order to use SSH between two Linux machines, no username and password are required. Therefore, the use of digital signature RSA or DSA to complete this operation.

Model analysis

Assuming that a (192.168.20.59) is a client machine, B (192.168.20.60) is the target machine;
The purpose to be achieved:
A machine SSH login B machine does not need to enter a password;
Encryption method to select RSA|DSA, the default DSA

ssh-keygen-t RSA #使用rsa加密

Second, the specific operation process

One-way landing procedures (to meet the above purposes):
1, Login a machine
2, Ssh-keygen-t [RSA|DSA] (for example: ssh-keygem-t RSA (DSA)), will generate the key file and private key file id_rsa,id_rsa.pub or id_dsa,id_dsa.pub
3. Copy the. pub file to the. SSH directory of B machine, and cat id_dsa.pub >> ~/.ssh/authorized_keys
4, finished, from a machine login B machine target account, no longer need password; (directly run #ssh 192.168.20.60)

The above is also the role of deploy key,

Set Deploy key is set on the Gitlab, deploy key is to update a project without a password, read-only way,

Way:

Login Gitlab-> Select setting-> Select Deploy key


Add:

To configure. Ssh/config

For example: Vim. Ssh/config Host gitlab.rd.xxxxx.com
User git
Identityfile ~/.ssh/xxxxxxx.pub





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.