0x1 安裝完畢GitLab以后我們創(chuàng)建項(xiàng)目通過SSH協(xié)議克隆到本地
遇到的問題
配置好了SSH-KEY但是還是不能免密 克隆項(xiàng)目到本地
0x2 解決方案
修改GitLab配置文件 vim /etc/gitlab/gitlab.rb
[root@gitlab ~]# vim /etc/gitlab/gitlab.rb
修改456行 打開注釋 開放 gitlab_shell_ssh_port端口22
修改56行 去除注釋 修改URL地址為本機(jī)地址
編譯配置文件生效
[root@gitlab ~]# gitlab-ctl reconfigure
- restart service service[sidekiq]
Recipe: gitlab::gitlab-rails
* execute[clear the gitlab-rails cache] action run
- execute /opt/gitlab/bin/gitlab-rake cache:clear
Recipe: <Dynamically Defined Resource>
* service[nginx] action restart
- restart service service[nginx]
* service[grafana] action restart
- restart service service[grafana]
Running handlers:
Running handlers complete
重啟服務(wù)
[root@gitlab ~]# gitlab-ctl restart
ok: run: alertmanager: (pid 6658) 0s
ok: run: gitaly: (pid 6675) 0s
ok: run: gitlab-exporter: (pid 6694) 1s
ok: run: gitlab-workhorse: (pid 6696) 0s
ok: run: grafana: (pid 6719) 1s
ok: run: logrotate: (pid 6738) 0s
ok: run: nginx: (pid 6745) 1s
ok: run: node-exporter: (pid 6753) 0s
ok: run: postgres-exporter: (pid 6760) 0s
ok: run: postgresql: (pid 6770) 1s
ok: run: prometheus: (pid 6785) 0s
ok: run: redis: (pid 6801) 1s
ok: run: redis-exporter: (pid 6873) 0s
ok: run: sidekiq: (pid 6921) 1s
ok: run: unicorn: (pid 6932) 0s
0x3 git clone 項(xiàng)目到本地時(shí)提示輸入git密碼解決方案
#激活git用戶
[root@gitlab ~]# sudo passwd -u -f git
#修改密碼
passwd git
0x4 SSH-KEY 上傳到GitLab服務(wù)器 免密登錄
cat id_rsa.pub 復(fù)制
0x5 客戶端測(cè)試
git clone git@192.168.1.18:root/1111.git