git command line, sometimes complete the graphics interface can not complete the work.
One, client configuration
1, generate public and private keys
# CD ~/.ssh
# ssh-keygen-t rsa-b 4096
generating public/private RSA key pair.
enter file in which to save the key (/HOME/TANK/.SSH/ID_RSA)://Custom file name, the following all the way to enter the line
2, add configuration file
# vim ~/.ssh/config
Host 192.168.10.202//git server
Hostname 192.168.10.202
User zhangying
Identityfile/home/tank/.ssh/zhangying//private key
Host 192.168.10.201//git service side
Hostname 192.168. 10.201
User zhangying
Identityfile/home/tank/.ssh/zhangying//Private key
Under Windows, the GIT command line can also be set as a sample. with Git bash.
# chmod ~/.ssh/config
This step is very important, otherwise it will be reported, bad owner or permissions on xxxxxxxx
3, install Git
# yum install-y git//install client
Second, put the public key on the GIT server
1, if used Gitlab, will. pub file in SSH directory open, content copy to Gitlab background SSH Key Management in the OK.
2, if used gitolite, login to git server, modify
# vim ~/.ssh/authorized_keys
command= "/home/git/bin/gitolite-shell zhangying", no-port-forwarding, No-x11-forwarding,no-agent-forwarding,no-pty
Here, the contents of the. pub file must be on one line
The zhangying behind the Gitolite-shell is the user name