我有一種情況下,對於大小的限制,我不能作爲一個特定的網站在同一臺服務器上的裸倉庫。所以我已經在服務器A上建立了一個裸倉庫,我希望在推動主分支的時候也很高興。 在掛鉤/更新後,它應該ssh到活服務器並拉動主分支。更新後的ssh遠程現場服務器和拉主分支問題
我在現場服務器上生成了一個公共ssh密鑰,授權它並將公鑰複製到裸露的repo服務器上的/var/www/.ssh/authorized_keys文件中。 Bascially做了這個網站上的所有內容here
但是它試圖驗證到活服務器時失敗。
更新之後看起來是這樣的:
ssh [email protected]
cd cd/path/to/site/.git || exit
git pull bare master
exit
我得到這個消息
$ git push server master
[email protected]'s password:
Counting objects: 5, done.
Delta compression using up to 3 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 279 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
remote:
remote: *** Pulling changes into Live [Live's post-update hook] ***
remote:
remote: Permission denied, please try again.
remote: Permission denied, please try again.
remote: Permission denied (publickey,gssapi-with-mic,password).
remote: fatal: The remote end hung up unexpectedly
To ssh://[email protected]/var/git/websiteToUpdate.git
b251909..883d129 master -> master
您將「活」和「A」服務器混淆了一下。你也不會在任何地方以'www'用戶身份登錄,所以你爲什麼提到'/ var/www/.ssh/authorized_keys'(存儲任何與ssh相關的文件根目錄可能是個壞主意)。 –