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