2012年11月12日 星期一

Jenkins git ssh

之前Jenkins 我一直搞不定 git by ssh

後來終於知道大概是什麼原因了

1. Jenkins 是用Jenkins的權限

    所以簡單來說 我製作一個 Jenkins的帳號  然後產生 rsa

2.  因為 Jenkins 用ssh時  不能還要輸入密碼

    因為之前不知道 ssh-add 的這個指令

    所以只要將 rsa 加入 ssh中  只要先連過一次,之後就不用打密碼了 .... 應該是之後都不用吧orz



參考下面資料


https://confluence.atlassian.com/pages/viewpage.action?pageId=270827678#SetupSSHforGitandMercurialonMacOSX/Linux-enablessh

Step 4. Start the ssh-agent and load your keys

Users who work in OSX 10.6.8 or later have the option of skipping this step.  Under OSX, the system asks for your connection parameters the first time you try to establish a connection.  It also automatically starts the ssh-agent for you at this time.
Open a terminal window and enter the ps -e | grep [s]sh-agent command to see if the agent is running:
myhost:~ manthony$ ps -e  | grep [s]sh-agent
 9060 ??         0:00.28 /usr/bin/ssh-agent -l
If the agent isn't running, start it manually with the following command:
myhost:~ manthony$ ssh-agent /bin/bash
Load your new identity into the ssh-agent management program using the ssh-add command.
$ ssh-add ~/.ssh/id_rsa
Enter passphrase for /Users/manthony/.ssh/id_rsa: 
Identity added: /Users/manthony/.ssh/id_rsa (/Users/manthony/.ssh/id_rsa)
myhost:~ manthony$ 
Use the ssh-add command to list the keys that the agent is managing.
$ ssh-add -l
2048 7a:9c:b2:9c:8e:4e:f4:af:de:70:77:b9:52:fd:44:97 /Users/manthony/.ssh/id_rsa (RSA)

沒有留言:

張貼留言