Jenkins 該如何使用SSH 存取AD(LDAP) 驗證的Git server | Jenkins Credentials SSH key
Jenkins該如何使用SSH存取AD(LDAP)驗證的Gitserver最近公司的專案正積極地從SVN搬遷到GIT,所以連帶的CIServer-Jenkins這邊的SCM(SourceCodeManagement)也需要一併調整,同事為了不想寫死帳號密碼所以打算透過SSH來存取GitServer,公司為了讓大家使用上更便利,也讓大家不用記那麼多組帳號密碼,Gitserver的驗證是整合AD,而在進行Jenkins整合gitserver時發現網路比較少使用AD搭配SSH的做法,所以紀錄一下,另外公司目前Gitserver是使用self-host的gitlab,所以接下來的demo,Gitserver的部份會使用Gitlab來呈現。產生AD帳號的SSHKey...
Jenkins 該如何使用 SSH 存取 AD(LDAP) 驗證的 Git server最近公司的專案正積極地從 SVN 搬遷到 GIT,所以連帶的 CI Server - Jenkins 這邊的 SCM (Source Code Management) 也需要一併調整,同事為了不想寫死帳號密碼所以打算透過 SSH 來存取 Git Server,公司為了讓大家使用上更便利,也讓大家不用記那麼多組帳號密碼,Git server 的驗證是整合 AD,而在進行 Jenkins 整合 git server 時發現網路比較少使用 AD 搭配 SSH 的做法,所以紀錄一下,另外公司目前 Git server 是使用 self-host 的 gitlab ,所以接下來的 demo ,Git server 的部份會使用 Gitlab 來呈現。
產生 AD 帳號的 SSH Key確認 AD 帳號
最直接的方式就是去看 .gitconfig (通常位於 C:Users{username}) 內容, 確認對應 crendential 所設定的 username
Generate SSH key
檢查 SSH 是否正確
這邊請參考小風的做法 2013-04-23 Windows使用ssh對Github進行操作[1]
將上面的 .ssh 包含產生出來的 key copy 至 C:Program Files (x86)Git 下
執行 ssh -T {git server}
ssh -T [email protected][2]
將 Public Key 綁定至 Gitlab 的帳號登入 Git Server開啟 Settins開啟 SSH tab將上面產生的 id_rsa.pub 內容複製並貼上
Jenkins 設定加入 SSH 的 credential
Job 設定
參考資訊git教學(github、gitlab)[3]2013-04-23 Windows使用ssh對Github進行操作[4]References 2013-04-23 Windows使用ssh對Github進行操作 (dotblogs.com....