友情链接1:21点 足球投注 投注网 明升体育 hg0088 葡京赌场 网上赌球 诈金花 澳门金沙网址 澳门银河网址 澳门银河 澳门银河官网 银河官网 威尼斯人 澳门威尼斯人 澳门威尼斯人官网 威尼斯人官网 金沙 澳门金沙 澳门金沙官网 金沙官网 现金网 赌球网 全讯网 明升国际 足球开户 ******官网 ******网址 现金赌博 澳门现金网 ******官方网站

鎼缓Git鏈嶅姟鍣 | Mingo's Blog

鎼缓Git鏈嶅姟鍣

鏃堕棿锛2016骞09鏈21鏃浣滆咃細Mingo琚洿瑙備簡锛693 娆璇勮娆℃暟锛0

绗竴姝ワ細瀹夎Git

$ ubuntu锛歴udo apt-get install git
# centos锛 yum install -y git

 

绗簩姝ワ細鍒涘缓涓涓猤it鐢ㄦ埛锛岀敤鏉ヨ繍琛実it鏈嶅姟

$ sudo adduser git

 

绗笁姝ワ細绂佺敤git鐢ㄦ埛鐨剆hell鐧诲綍

鍑轰簬瀹夊叏鑰冭檻锛岀浜屾鍒涘缓鐨刧it鐢ㄦ埛涓嶅厑璁哥櫥褰晄hell锛岃繖鍙互閫氳繃缂栬緫/etc/passwd鏂囦欢瀹屾垚銆傛壘鍒扮被浼间笅闈㈢殑涓琛岋細

$ git:x:1001:1001:,,,:/home/git:/bin/bash

鏇挎崲涓

$ git:x:1001:1001:,,,:/home/git:/usr/bin/git-shell

杩欐牱git鐢ㄦ埛灏变笉鑳絪hell鐧诲綍锛屼絾鏄繕鏄彲浠ラ氳繃ssh浣跨敤git鏈嶅姟銆

绗洓姝ワ細鍒濆鍖朑it浠撳簱

鍏堥夊畾涓涓洰褰曚綔涓篏it浠撳簱锛屽亣璁炬槸/home/git/repository/sample.git,鍦/home/git/repository/鐩綍涓嬭緭鍏ュ懡浠わ細

$ git init --bare sample.git
$ chown git:git sample.git

鎶妎wner鏀逛负git銆

绗簲姝ワ細clone 杩滅▼浠撳簱

root@ubuntu:/# git clone git@192.168.109.130/home/git/repositories/sample.git

fatal: repository ‘git@192.168.109.130/home/git/repositories/sample.git’ does not exist

root@ubuntu:/# git clone git@192.168.109.130:/home/git/repositories/sample.git

Cloning into ‘sample’…

The authenticity of host ’192.168.109.130 (192.168.109.130)’ can’t be established.

ECDSA key fingerprint is 32:f8:db:69:2a:1c:1a:d1:21:59:29:06:e4:1e:55:b1.

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

Warning: Permanently added ’192.168.109.130′ (ECDSA) to the list of known hosts.

git@192.168.109.130′s password:

warning: You appear to have cloned an empty repository.

Checking connectivity… done.

 

 

 

 

 

 

 

 

 

 

 

 

杩欓噷鎻愮ず浣犺緭鍏ュ瘑鐮佹墠鑳絚lone锛屽綋鐒跺鏋滀綘鐭ラ亾瀵嗙爜锛屽彲浠ラ敭鍏ュ瘑鐮佹潵杩涜clone锛屼絾鏄洿涓哄父瑙佺殑鏂瑰紡锛屾槸鍒╃敤SSH鐨勫叕閽ユ潵瀹屾垚楠岃瘉銆

 

鍒涘缓SSH Key锛

棣栧厛鍦ㄧ敤鎴蜂富鐩綍涓嬶紝鐪嬬湅鏈夋病鏈.ssh鐩綍锛屽鏋滄湁锛屽啀鐪嬬湅杩欎釜鐩綍涓嬫湁娌℃湁id_rsa鍜宨d_rsa.pub杩欎袱涓枃浠讹紝濡傛灉宸茬粡鏈変簡锛屽彲鐩存帴璺冲埌涓嬩竴姝ャ傚鏋滄病鏈夛紝鎵撳紑Shell锛圵indows涓嬫墦寮Git Bash锛夛紝鍒涘缓SSH Key锛

 

ssh -keygen -t rsa -C "youremail@example.com"

youremail@example.com 鏇挎崲涓轰綘鑷繁鐨email

濡傛灉涓鍒囬『鍒╃殑璇濓紝鍙互鍦ㄧ敤鎴蜂富鐩綍閲屾壘鍒.ssh鐩綍锛岄噷闈㈡湁id_rsa鍜宨d_rsa.pub涓や釜鏂囦欢锛岃繖涓や釜灏辨槸SSH Key鐨勭閽ュ锛宨d_rsa鏄閽ワ紝涓嶈兘娉勯湶鍑哄幓锛宨d_rsa.pub鏄叕閽ワ紝鍙互鏀惧績鍦板憡璇変换浣曚汉銆

鏈嶅姟鍣ㄧ璁剧疆锛

鍦℅it鏈嶅姟鍣ㄤ笂娣诲姞浣犵殑鍏挜鐢ㄦ潵楠岃瘉浣犵殑淇℃伅浜嗐傞鍏堥渶瑕佸湪/etc/ssh/sshd_config涓皢RSA璁よ瘉鎵撳紑锛屽嵆锛

RSAAuthentication yes聽聽聽聽

PubkeyAuthentication yes
AuthorizedKeysFile聽 .ssh/authorized_keys

杩欓噷鎴戜滑鍙互鐪嬪埌鍏挜瀛樻斁鍦.ssh/authorized_keys鏂囦欢涓傛墍浠ユ垜浠湪/home/git涓嬪垱寤.ssh鐩綍锛岀劧鍚庡垱寤篴uthorized_keys鏂囦欢锛屽苟灏嗗垰鐢熸垚鐨勫叕閽ュ鍏ヨ繘鍘伙紝涓琛屼竴涓

澹版槑: 鏈枃閲囩敤 BY-NC-SA 鍗忚杩涜鎺堟潈 | Mingo's Blog
杞浇璇锋敞鏄庤浆鑷鎼缓Git鏈嶅姟鍣

鍒嗙被锛Java缂栫▼
0鏉¤瘎璁

鏆傛椂娌℃湁璇勮锛

鍙戣〃璇勮

*

*