我有一個beaglebone,我建立了一段時間(當我第一次學習git)與ssh密鑰爲特定的github帳戶。該帳戶是我們公司的主要帳戶。許多人直接工作,並直接從beaglebone推到github上。我想更改設置,以便每當有人想要提交或推送到github時,都會查詢他們的用戶名。更改git設置以允許多個用戶推送/提交文件
我最近的提交和推送看起來像這樣...您會看到我無法輸入用戶名,只是公司主帳戶的密碼。
[email protected]:/var/lib/cloud9/pypos# git commit -a -m "class restructured and passing the new updated test script"
[class_restructure 1db2e33] class restructured and passing the new updated test script
2 files changed, 14 insertions(+), 10 deletions(-)
[email protected]:/var/lib/cloud9/pypos# git push origin class_restructure
Enter passphrase for key '/home/root/.ssh/id_rsa':
Counting objects: 7, done.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 531 bytes, done.
Total 4 (delta 3), reused 0 (delta 0)
To [email protected]:FarmDesign/pypos.git
83831a8..1db2e33 class_restructure -> class_restructure
[email protected]:/var/lib/cloud9/pypos#
不幸的是我很難設置一個https(這是一個私有存儲庫),這就是爲什麼我使用SSH密鑰...我明白,通過SSH在同一臺機器上使用多個用戶是不可能的? – Chris 2013-04-15 15:55:53
您應該可以爲私有存儲庫設置HTTPS。我有私人回購協議,並沒有使用HTTPS的麻煩。但是,您必須將其他GitHub用戶作爲協作者添加到回購站,以便他們能夠通過HTTPS訪問回購站。 至於使用SSH密鑰和多個用戶 - 是的,可能有多個用戶在同一臺計算機上並使用SSH。如果每個用戶的ssh密鑰都存儲在一個單獨的用戶帳戶中,那麼這是可能的。但是,我注意到您使用的是根帳戶中的ssh密鑰(請參閱您的問題,輸入密鑰「/home/root/.ssh/id_rsa':')的密碼。 – 2013-04-15 17:03:07