九 Deepin配置ssh访问gitee
生活随笔
收集整理的這篇文章主要介紹了
九 Deepin配置ssh访问gitee
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
對于gitee上的私有代碼,如果使用https下載或上傳,則需要每次進行登錄認證。
使用ssh可以非常方便進行代碼管理。
?
一、客戶端(Linux)配置
?
1、生成密鑰、公鑰。
自定義一個目錄中生成相應的密鑰, 注意 -C 參數后面是郵箱模式,請寫自己的郵箱; 命令中Enter passphrase直接回車,不設密碼
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 : 密鑰或私鑰,用于客戶端認證時使用。一般使用xshell 工具,或git clone時會使用。
id_rsa.pub:公鑰或證書,存在于服務器上。一般配置在sshd的服務器上,或在配置GITEE/GITHUB上。
2、將生成的id_rsa 放到ssh的目錄
一般在 ~/.ssh目錄中(用戶目錄中)
mkdir -p ~/.ssh cp id_rsa ~/.ssh二、配置gitee的公鑰
登錄gitee,點擊設置 -> SSH公鑰, 將id_rsa.pub文件內容復制到輸入框中,保存。
三、測試及使用
?
1、測試方法
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、使用方法
選擇項目,復制ssh的方法
?
下載倉庫
wangxinyu@wangxinyu-PC:~/work/temp$ git clone git@gitee.com:wangxinyu2011/wxy_code_backup.git?
?
?
總結
以上是生活随笔為你收集整理的九 Deepin配置ssh访问gitee的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 八 python 环境安装
- 下一篇: 十 ubus安装编译