jenkins啟動使用系統賬戶導致的坑--windows


1.git拉取代碼時如果使用系統用戶,第一次拉取會彈出一個提示框,

實際現象:卡在GIT_SSH或git clone

jenkins給出的原因:By default, the Jenkins Windows installer sets up Jenkins to run as a service on Windows, which runs as the “Local System account”, NOT your user account. Since the “Local System account” does not have SSH keys or known_hosts set up, “git clone” will hang during the build.
意思其實就是jenkins本身會使用windows的系統用戶,而不是當前安裝打開jenkins服務器所使用的用戶,所以會導致有一個對話框一直看不到
 
 
 
解決方案:
1.使用pstools進入系統用戶命令行來解決這個問題
  https://docs.microsoft.com/zh-cn/sysinternals/downloads/psexec
  解壓zip
  進入文件夾打開命令行輸入   PsExec.exe -i -s cmd.exe    
  進入系統命令行框后---"D:\Program Files\Git\usr\bin\ssh.exe" -T git@your.git.server

  彈出Are you sure you want to continue connecting (yes/no)?
  點擊確認后jenkins那邊就可以正常GIT 來去代碼了

 

2.進入服務框找到jenkins,修改打開用戶(概念方案沒試過)

 

 

 
 
 
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM