gitlab使用SSH无法下载
生活随笔
收集整理的這篇文章主要介紹了
gitlab使用SSH无法下载
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
問題描述:
git下載gitlab倉庫中代碼,出現(xiàn)使用http能使用,但是ssh下載一直需要報(bào)輸入密碼,密碼也一直輸入不正確問題。
[root@web-m data]# git clone ssh://git@gitlab.lixinkuan.com:22022/lxk/core.git Cloning into 'core'... git@gitlab.lixinkuan.com's password: Permission denied, please try again. git@gitlab.lixinkuan.com's password: Permission denied, please try again. git@gitlab.lixinkuan.com's password: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). fatal: Could not read from remote repository.Please make sure you have the correct access rights and the repository exists.解決辦法:
1,創(chuàng)建ssh-key
輸入ssk-keygen之后一直按enter,使用默認(rèn)參數(shù)
/.ssh$ ssh-keygen Enter file in which to save the key (/home/airgens/.ssh/id_rsa):2,將公鑰加載進(jìn)去
ssh-add ~/.ssh/id_rsa
ssh-add ~/.ssh/id_rsa上面操作如果出現(xiàn)錯(cuò)誤:
Agent admitted failure to sign using the key
則需要先運(yùn)行
ssh-agent bash --login -i3,需要在gitlab管理頁面添加ssh-key
cat id_rsa.pub? 將內(nèi)容拷貝到如下位置?
?4,驗(yàn)證OK
xxg@ubuntu:~/.ssh$ git clone git@192.168.xx.61:cszsfs/Android11.0.git Cloning into 'Android11.0'... ^Cmote: Enumerating objects: 713441分析:
該問題是由于本地ssh生成的秘鑰未添加到ssh代理中導(dǎo)致
總結(jié)
以上是生活随笔為你收集整理的gitlab使用SSH无法下载的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: html5大赛是什么,IE9开发大赛为H
- 下一篇: html链接txt文件,怎么在TXT文件