九 Deepin配置ssh访问gitee
生活随笔
收集整理的這篇文章主要介紹了
九 Deepin配置ssh访问gitee
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
對(duì)于gitee上的私有代碼,如果使用https下載或上傳,則需要每次進(jìn)行登錄認(rèn)證。
使用ssh可以非常方便進(jìn)行代碼管理。
?
一、客戶端(Linux)配置
?
1、生成密鑰、公鑰。
自定義一個(gè)目錄中生成相應(yīng)的密鑰, 注意 -C 參數(shù)后面是郵箱模式,請(qǐng)寫(xiě)自己的郵箱; 命令中Enter passphrase直接回車,不設(shè)密碼
wangxinyu@wangxinyu-PC:~/work/.ssh$ ssh-keygen -t rsa -C xxxx@qq.com Generating public/private rsa key pair. Enter file in which to save the key (/home/wangxinyu/.ssh/id_rsa): ./id_rsa Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in ./id_rsa. Your public key has been saved in ./id_rsa.pub. The key fingerprint is: SHA256:oYP90kd2TJnKPcRaYfP9faTG1c89OoUruW3DYyopFTQ xxxx@qq.com The key's randomart image is: +---[RSA 2048]----+ | + | | E o * ..| | o . B . =| | o . + O ..==| | . + S B =.+oB| | + + ..o+ o| | . + oo.+ | | o + +*. | | . .o+.o | +----[SHA256]-----+ wangxinyu@wangxinyu-PC:~/work/.ssh$ ls id_rsa id_rsa.pub wangxinyu@wangxinyu-PC:~/work/.ssh$id_rsa : 密鑰或私鑰,用于客戶端認(rèn)證時(shí)使用。一般使用xshell 工具,或git clone時(shí)會(huì)使用。
id_rsa.pub:公鑰或證書(shū),存在于服務(wù)器上。一般配置在sshd的服務(wù)器上,或在配置GITEE/GITHUB上。
2、將生成的id_rsa 放到ssh的目錄
一般在 ~/.ssh目錄中(用戶目錄中)
mkdir -p ~/.ssh cp id_rsa ~/.ssh二、配置gitee的公鑰
登錄gitee,點(diǎn)擊設(shè)置 -> SSH公鑰, 將id_rsa.pub文件內(nèi)容復(fù)制到輸入框中,保存。
三、測(cè)試及使用
?
1、測(cè)試方法
wangxinyu@wangxinyu-PC:~/work/.ssh$ ssh -T git@gitee.com Hi wangxinyu2011! You've successfully authenticated, but GITEE.COM does not provide shell access. wangxinyu@wangxinyu-PC:~/work/.ssh$2、使用方法
選擇項(xiàng)目,復(fù)制ssh的方法
?
下載倉(cāng)庫(kù)
wangxinyu@wangxinyu-PC:~/work/temp$ git clone git@gitee.com:wangxinyu2011/wxy_code_backup.git?
?
?
總結(jié)
以上是生活随笔為你收集整理的九 Deepin配置ssh访问gitee的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 八 python 环境安装
- 下一篇: 十 ubus安装编译