通過SSH認證串連GIT

來源:互聯網
上載者:User

通過SSH認證串連GIT 一,串連許可權認證         有多種辦法可以串連到GIT伺服器,以擷取或提交資料,主要包括1.        每個開發人員建立賬賬戶。2.        SSH公開金鑰認證。3.        集中授權,然後與SHELL訪問權相同。  www.2cto.com  二,產生公開金鑰         為了方便使用(就是不用賬戶什麼的東西),我們所有的項目都用SSH公開金鑰進行認證,
所以我們的第一步驟是產生公開金鑰。 命令是:ssh-keygen -C"maoxiang@pachiratech.com" -t rsa 執行和輸出結果如下:  www.2cto.com   [root@localhost .ssh]$ ssh-keygen -C"xxx@qq.com" -t rsaGenerating public/private rsa key pair.Enter file in which to save the key(/root/.ssh/id_rsa):Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in/root/.ssh/id_rsa.Your public key has been saved in/root/.ssh/id_rsa.pub.The key fingerprint is:d2:5f:a7:c4:fa:66:1d:b8:64:49:31:03:e5:d8:3b:6exxx@qq.comThe key's randomart image is:+--[ RSA 2048]----+|         .o.    ||          ++    ||         . o+   ||      .   ...   ||     . S  .*o.  ||      . . ==+.  ||         ooEo . ||          o+ .  ||          o.    |+-----------------+[root@localhost .ssh]$ lsid_rsa id_rsa.pub[root@localhost .ssh]$執行完這個命令後,在/root/.ssh/目錄有兩個檔案,這兩個檔案就是私密金鑰和公開金鑰檔案,英文稱之為keypair。接下來只需要把這兩個檔案中的公開金鑰檔案加到GIT使用者的authorized_keys檔案之中就可以了(這一步可把該檔案發送給GIT管理員)。在這之後,就可以通過SSH認證的方式串連遠端GIT伺服器了。也就是你可以直接執行git相關的命令了 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.